1. **初始化(Initialization)**
MHSDK 的初始化需要使用 **Key** 和**APPID**进行鉴权。向商务经理申请测试,我们会提供测试key。MHSDK初始化函数程序中调用一次即可,建议用户在Appdelegate中调用。
MHSDK initialization requires key authentication. Apply to the business manager for the test, and we will provide the test key. MHSDK initialization function program can be called once, it is recommended that users call in Appdelegate.
- 在Appdelegate中导入MHSDK头文件
(Appdelegate.m add MHSDK)
```
#import <MHBeautySDK/MHSDK.h>
```
- 在Appdelegate的didFinishLaunchingWithOptions
方法中注册授权。xxxxxxx为申请的Key和APPID。
“didFinishLaunchingWithOptions”add this method:
```
[[MHSDK shareInstance] initWithAppID:XXXX key:XXXXX];
```
说明:可以在控制台查看输出的认证状态,正确的为“美狐SDK认证状态--正版授权”。
Tip:You can view the output authentication status on the console. The correct one is "美狐SDK认证状态--正版授权".
1. **美颜功能说明 (Beauty function description)**
1) 一键美颜、大眼、瘦脸、嘴型、鼻型、下巴、额头、高级面具和贴纸是高级版本的功能。其中水印功能修改图片的话,水印图片在水印文件夹中,可以直接替换里面的图片,建议名称不要做修改,如果修改名称的话,相对应修改WatermarkImages.plist文件中的imageName和MHPrintView文件中图片名称。提供四张宽158,高182的水印图片,外加150\*150的 水印图标图片。图片以位置的方式命名的,带\_selected的表示水印图片,不带的表示图标。(One click beauty, big eyes, thin face, mouth, nose, chin, forehead, advanced mask and sticker are the functions of the advanced version. If the watermark function modifies the picture, the watermark picture is in the watermark folder and can directly replace the picture inside. It is recommended not to modify the name. If you modify the name, you should modify watermarkimages accordingly Imagename in plist file and picture name in mhprintview file. Provide four watermark pictures 158 wide and 182 high, plus 150 \* 150 watermark icon Pictures. The picture is named by location, with\_ Selected indicates the watermark image, and without indicates the icon.)
2) 自定义美颜功能的时候,一定要在下面的方法之后去调用具体美型美颜滤镜功能(When customizing the beauty function, you must call the specific beauty filter function after the following methods:):
\[self.beautyManager processWithTexture:texture width:width height:height\];
3) 贴纸加载依赖于SDWebImage框架,为防止重复导入,MHSDK并没有提供SDWebImage,如果本项目中没有的话请自行导入。(Sticker loading depends on the sdwebimage framework. In order to prevent repeated import, mhsdk does not provide sdwebimage. If not in this project, please import it yourself.)
4) 调用美型之前要设置参self.beautyManager.isUseFaceBeauty = YES;(Before calling beauty, set the parameter self beautyManager. isUseFaceBeauty = YES;)
1. **语言包切换功能(Language pack switching function)**
英文版和中文版图片资源和文件名称不一样,功能和效果上并无差别。比如,中文版图片资源在MHSDK.bundle。英文版在MHForeignResource.bundle,中文版美颜菜单页面是MHMeiyanMenusView,英文版是BeautyFoxMenusView。其余资源是共用的,比如Model,View文件夹,如果同时导入项目中会报错,按照需要导入即可。
(The names of image resources and documents in English and Chinese versions are different, and there is no difference in function and effect. For example, the Chinese version of image resources is available in MHSDK.bundle。 The English version is available at MHForeignResource.bundle, the Chinese version of the beauty menu page is MHMeiyanMenusView and the English version is BeautyFoxMenusView. Other resources are shared, such as Model and View folders. If you import the project at the same time, an error will be reported. You can import them as needed.)
文件中都做了语言包切换功能,只需要在进入直播/短视频界面之前调用方法,可以进行语言切换。目前只有汉语,英语,越南语这三个语言包.
(In the file, the language pack switch function is done. It only needs to call the method before entering the live / short video interface, and can switch the language. At present, there are only three language packs: Chinese, English and Vietnamese)
```
//英文 English
#define kLanguage_EN @"en"
//汉语 Chinese
#define kLanguage_ZH @"zh-Hans"
语言切换方法(Language switching method)
[[RookieTools shareInstance] resetLanguage:kLanguage_EN withFrom:@""];
```
- 美狐SDK接入文档
- Meihu SDK Access Document
- (Untitled)
- 一、基础描述(Basic description)
- 1. 最新特性 (Latest features)
- 2. 支持平台 (Support platform)
- 二、集成步骤 (Integration steps)
- 3. 配置工程(Configuration Engineering)
- 4. 使用 MHUI (Use MHUI)
- 5. 腾讯直播 SDK/短视频SDK (Tencent live SDK / short video SDK)
- 6. 金山直播SDK (Jinshan)
- 7. 七牛直播SDK (Qiniu Live)
- 8. 七牛短视频SDK (Qiniu ShortVideo)
- 9. Movieous短视频 (Movieous short Video)
- 10. 即构直播SDK (Zego live)
- 11. 即构实时音视频SDK(Zego Real time audio and video)
- 12. 新版Zego(即构)实时音视频(New Zego Real time audio and video)
- 13. 网易直播 (NetEase live)
- 14. 腾讯互动直播 (Tencent interactive live broadcast)
- 15. 腾讯实时音视频(Tencent real-time audio and video)
- 16. 融云实时音视频 (SealRTC)
- 17. 声网视频通话 (Agora video call)
- 18. 声网直播 (Agora Live)
- 19. 阿里直播 (Ali Live)
- 20. 阿里音视频 SDK美颜
- 三、对接说明 (Docking instructions)
- 四、常见问题(common problem)
- 2. 美颜无效果(Beauty has no effect)
- 3. 贴纸下载失败(Sticker download failed)
- 4. 点击无法出现美颜菜单页(The beauty menu page cannot appear after clicking)
- 5. 英文版显示中文(The beauty menu page cannot appear after clicking)
- 6. 语言切换功能(Language switching function)