|
|
@ -479,6 +479,7 @@ class RTCManager { |
|
|
} |
|
|
} |
|
|
await _engine!.enableVideo(); |
|
|
await _engine!.enableVideo(); |
|
|
print('视频已启用'); |
|
|
print('视频已启用'); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/// 禁用视频 |
|
|
/// 禁用视频 |
|
|
@ -609,20 +610,20 @@ class RTCManager { |
|
|
); |
|
|
); |
|
|
print('正在加入频道:$channelId,UID:$uid,类型:$rtcType'); |
|
|
print('正在加入频道:$channelId,UID:$uid,类型:$rtcType'); |
|
|
if (role == ClientRoleType.clientRoleBroadcaster) { |
|
|
if (role == ClientRoleType.clientRoleBroadcaster) { |
|
|
|
|
|
await _engine?.enableFaceDetection(true); |
|
|
|
|
|
|
|
|
await _engine?.enableContentInspect( |
|
|
await _engine?.enableContentInspect( |
|
|
enabled: true, |
|
|
enabled: true, |
|
|
config: ContentInspectConfig( |
|
|
config: ContentInspectConfig( |
|
|
modules: [ |
|
|
modules: [ |
|
|
ContentInspectModule( |
|
|
ContentInspectModule( |
|
|
type: ContentInspectType.contentInspectImageModeration, |
|
|
|
|
|
interval: 10 |
|
|
|
|
|
|
|
|
type: ContentInspectType.contentInspectSupervision, |
|
|
|
|
|
interval: 15 |
|
|
) |
|
|
) |
|
|
], |
|
|
], |
|
|
moduleCount: 1 |
|
|
moduleCount: 1 |
|
|
) |
|
|
) |
|
|
); |
|
|
); |
|
|
await _engine?.enableFaceDetection(true); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -643,6 +644,19 @@ class RTCManager { |
|
|
await _engine!.leaveChannel(); |
|
|
await _engine!.leaveChannel(); |
|
|
_currentUid = null; |
|
|
_currentUid = null; |
|
|
print('已离开频道'); |
|
|
print('已离开频道'); |
|
|
|
|
|
|
|
|
|
|
|
await _engine?.enableContentInspect( |
|
|
|
|
|
enabled: false, |
|
|
|
|
|
config: ContentInspectConfig( |
|
|
|
|
|
modules: [ |
|
|
|
|
|
ContentInspectModule( |
|
|
|
|
|
type: ContentInspectType.contentInspectSupervision, |
|
|
|
|
|
interval: 15 |
|
|
|
|
|
) |
|
|
|
|
|
], |
|
|
|
|
|
moduleCount: 1 |
|
|
|
|
|
) |
|
|
|
|
|
); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/// 切换摄像头 |
|
|
/// 切换摄像头 |
|
|
@ -760,6 +774,19 @@ class RTCManager { |
|
|
await _engine?.setClientRole(role: ClientRoleType.clientRoleBroadcaster); |
|
|
await _engine?.setClientRole(role: ClientRoleType.clientRoleBroadcaster); |
|
|
await _engine?.muteLocalAudioStream(false); |
|
|
await _engine?.muteLocalAudioStream(false); |
|
|
await _engine?.muteLocalVideoStream(false); |
|
|
await _engine?.muteLocalVideoStream(false); |
|
|
|
|
|
|
|
|
|
|
|
await _engine?.enableContentInspect( |
|
|
|
|
|
enabled: true, |
|
|
|
|
|
config: ContentInspectConfig( |
|
|
|
|
|
modules: [ |
|
|
|
|
|
ContentInspectModule( |
|
|
|
|
|
type: ContentInspectType.contentInspectSupervision, |
|
|
|
|
|
interval: 15 |
|
|
|
|
|
) |
|
|
|
|
|
], |
|
|
|
|
|
moduleCount: 1 |
|
|
|
|
|
) |
|
|
|
|
|
); |
|
|
await RTMManager.instance.publishChannelMessage( |
|
|
await RTMManager.instance.publishChannelMessage( |
|
|
channelName: _currentChannelId ?? '', |
|
|
channelName: _currentChannelId ?? '', |
|
|
message: json.encode({ |
|
|
message: json.encode({ |
|
|
@ -770,6 +797,7 @@ class RTCManager { |
|
|
: 'female_audience', |
|
|
: 'female_audience', |
|
|
}), |
|
|
}), |
|
|
); |
|
|
); |
|
|
|
|
|
print("发布视频"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/// 发布音频 |
|
|
/// 发布音频 |
|
|
@ -792,6 +820,19 @@ class RTCManager { |
|
|
await _engine?.setClientRole(role: ClientRoleType.clientRoleAudience); |
|
|
await _engine?.setClientRole(role: ClientRoleType.clientRoleAudience); |
|
|
await _engine?.muteLocalAudioStream(true); |
|
|
await _engine?.muteLocalAudioStream(true); |
|
|
await _engine?.muteLocalVideoStream(true); |
|
|
await _engine?.muteLocalVideoStream(true); |
|
|
|
|
|
|
|
|
|
|
|
await _engine?.enableContentInspect( |
|
|
|
|
|
enabled: false, |
|
|
|
|
|
config: ContentInspectConfig( |
|
|
|
|
|
modules: [ |
|
|
|
|
|
ContentInspectModule( |
|
|
|
|
|
type: ContentInspectType.contentInspectSupervision, |
|
|
|
|
|
interval: 15 |
|
|
|
|
|
) |
|
|
|
|
|
], |
|
|
|
|
|
moduleCount: 1 |
|
|
|
|
|
) |
|
|
|
|
|
); |
|
|
await RTMManager.instance.publishChannelMessage( |
|
|
await RTMManager.instance.publishChannelMessage( |
|
|
channelName: _currentChannelId ?? '', |
|
|
channelName: _currentChannelId ?? '', |
|
|
message: json.encode({ |
|
|
message: json.encode({ |
|
|
|