Open Vinayak006 opened 7 months ago
I am not showing the remote video stream. I'm calling the mobile application from the site, the site has its own video stream and the video stream of the phone, but the video stream from the site is not displayed on the phone, can you tell me what the problem is? MediaStream? remoteStream; RTCVideoRenderer? remoteRenderer = RTCVideoRenderer(); EdgeInsetsGeometry? localVideoMargin; double? localVideoHeight; double? localVideoWidth; String error = ''; bool showError = false;
Call? _call; Call? get getCall => _call; set setCall(Call call) => _call = call;
void initRender(CallState callState) async { try { await remoteRenderer!.initialize(); _handelStreams(callState); } catch (e) { logger.e(e); showError = true; error = 'Ошибка при обработке видео'; } notifyListeners(); }
void _handelStreams(CallState event) async { MediaStream? stream = event.stream;
logger.i('MYLOGGER STATE: ${event.state}');
logger.i('MYLOGGER VIDEO: ${event.video}');
if (event.originator == 'remote') {
try {
logger.i('MYLOGGER STREAM: ${stream}');
remoteRenderer?.srcObject = stream;
remoteStream = stream;
if (remoteStream!.getVideoTracks().isEmpty) {
showError = true;
error = 'Не найден видеопоток';
}
} catch (e) {
logger.e(e);
showError = true;
error = 'Ошибка при обработке видео';
}
}
notifyListeners();
}
You need call the "_handleStreams()" function in 'callStateChanged()' funtion, not inside the 'initRenderers()' @VadimKV44
@Vinayak006 I did as you said, but it didn't help. When making a video call, after accepting the call, there is also a black screen instead of a video, but the call itself ends after a few seconds. As I understood it in the video codec, flutter_webrtc has the V8 codec by default, and I receive a video stream in H264 format. I have been looking for a long time to change it, but I have not found it, please tell me if there is such a possibility at all?
Problem So when the camera is turned off, and then turned on, I don't know how to reflect changes to remote device
Code
Expected behavior When local camera is turned on, remote device should get the new mediastream
System Infomation() Flutter SDK Version: 3.19.5 sip_ua Version: 0.5.8