|
@@ -58,7 +58,7 @@ export class LiveService {
|
|
|
countdown: number = 0; // 新增倒计时变量
|
|
|
timer_countdown: any;
|
|
|
liveLog?: Parse.Object; //直播记录
|
|
|
-
|
|
|
+ isBeautyExtensionRegistered: boolean = false; //是否注册美颜扩展
|
|
|
isOpenEvaluate: boolean = false; //是否开启评价
|
|
|
processor: any; //音视频处理
|
|
|
constructor(
|
|
@@ -97,15 +97,16 @@ export class LiveService {
|
|
|
this.options['channel'] = '';
|
|
|
this.user_published_list = [];
|
|
|
this.client?.leave();
|
|
|
- if(!this.client){
|
|
|
- this.client = AgoraRTC.createClient({ mode: 'rtc', codec: 'h264' });
|
|
|
- AgoraRTC.enableLogUpload();
|
|
|
+ this.client = AgoraRTC.createClient({ mode: 'rtc', codec: 'h264' });
|
|
|
+ AgoraRTC.enableLogUpload();
|
|
|
+ if (!this.isBeautyExtensionRegistered) {
|
|
|
// 创建 BeautyExtension 实例
|
|
|
const extension: any = new BeautyExtension();
|
|
|
// 注册插件
|
|
|
AgoraRTC.registerExtensions([extension]);
|
|
|
// 创建 BeautyProcessor 实例
|
|
|
this.processor = extension.createProcessor();
|
|
|
+ this.isBeautyExtensionRegistered = true;
|
|
|
}
|
|
|
this.setBeautyOptions();
|
|
|
}
|