pod 'TEBeautyKit',:path => 'TEBeautyKit/TEBeautyKit.podspec'
TELiveAdapter.framework 添加到工程中。
pod install。[TEBeautyKit setTELicense:@"your license" key:@"your key" completion:^(NSInteger authresult, NSString * _Nullable errorMsg) {NSLog(@"----------result: %zd %@",authresult,errorMsg);}];
- (void)initBeautyJson{[[TEUIConfig shareInstance] setPanelLevel:S1_07];//根据美颜套餐选择}
-(TEPanelView *)tePanelView{if (!_tePanelView) {_tePanelView = [[TEPanelView alloc] init:nil comboType:nil];_tePanelView.delegate = self;}return _tePanelView;}[self.view addSubview:self.tePanelView];[self.tePanelView mas_makeConstraints:^(MASConstraintMaker *make) {make.width.mas_equalTo(self.view);make.centerX.mas_equalTo(self.view);make.height.mas_equalTo(250);make.bottom.mas_equalTo(self.view.mas_bottom);}];
-(TEBeautyLiveAdapter *)liveAdapter{if (!_liveAdapter) {_liveAdapter = [[TEBeautyLiveAdapter alloc] init];}return _liveAdapter;}__weak __typeof(self)weakSelf = self;[self.liveAdapter bind:self.livePusher onCreatedXmagicApi:^(XMagic * _Nullable xmagicApi) {__strong typeof(self) strongSelf = weakSelf;strongSelf.teBeautyKit.xmagicApi = xmagicApi;[strongSelf.teBeautyKit setLogLevel:YT_SDK_ERROR_LEVEL];strongSelf.tePanelView.teBeautyKit = strongSelf.teBeautyKit;[strongSelf.tePanelView setDefaultBeauty];} onDestroyXmagicApi:^{__strong typeof(self) strongSelf = weakSelf;[strongSelf.teBeautyKit onDestroy];strongSelf.teBeautyKit = nil;}];
//通知adapter前后置摄像头,是否编码镜像[self.liveAdapter notifyCameraChanged:self.isFrontCamera isEncoderMirror:self.isEncoderMirror];//通知adapter屏幕方向改变[self.liveAdapter setDeviceOrientation:orientation];
[self.liveAdapter unbind];self.liveAdapter=nil;
文档反馈