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)