|
|
|
@ -372,6 +372,21 @@ class RTCManager { |
|
|
|
print("当前人脸数:$numFaces"); |
|
|
|
|
|
|
|
}, |
|
|
|
onRemoteVideoStateChanged: ( |
|
|
|
RtcConnection connection, |
|
|
|
int remoteUid, |
|
|
|
RemoteVideoState state, |
|
|
|
RemoteVideoStateReason reason, |
|
|
|
int elapsed |
|
|
|
){ |
|
|
|
print("$remoteUid,$state"); |
|
|
|
print("变化变化"); |
|
|
|
if(state == RemoteVideoState.remoteVideoStateStopped){ |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
onError: (ErrorCodeType err, String msg) { |
|
|
|
print('RTC Engine 错误:$err,消息:$msg'); |
|
|
|
if (onError != null) { |
|
|
|
@ -385,6 +400,7 @@ class RTCManager { |
|
|
|
); |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
), |
|
|
|
); |
|
|
|
} |
|
|
|
@ -773,4 +789,20 @@ class RTCManager { |
|
|
|
}), |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
closeCamera() async { |
|
|
|
await _engine?.enableLocalVideo(false); |
|
|
|
} |
|
|
|
|
|
|
|
reOpenCamera() async { |
|
|
|
await _engine?.enableLocalVideo(true); |
|
|
|
await _engine?.updateChannelMediaOptions(ChannelMediaOptions( |
|
|
|
channelProfile: ChannelProfileType.channelProfileLiveBroadcasting, |
|
|
|
clientRoleType: _clientRole, |
|
|
|
autoSubscribeAudio: true, |
|
|
|
autoSubscribeVideo: true, |
|
|
|
publishCameraTrack: true, |
|
|
|
publishMicrophoneTrack: true, |
|
|
|
)); |
|
|
|
} |
|
|
|
} |