Open ollyde opened 2 years ago
I tried using
await Helper.switchCamera(
videoStream!.getVideoTracks()[0],
videoInputDeviceId,
videoStream,
);
But it just freezes on the other devices.
I got it working but it shows a grey screen on the other devices. If they rejoin it works. Not sure what that could be, any help would be great.
Current code
final oldTrack = videoStream?.getVideoTracks().first;
await oldTrack!.stop();
// Throws PlatformException(mediaStreamRemoveTrack: Track is nil, null, null, null)
// await videoStream?.removeTrack(oldTrack, removeFromNative: true);
MediaStream newTrackStream = await getDeviceStream(getRootContext());
final newTrack = newTrackStream.getVideoTracks().first;
await videoStream!.addTrack(newTrack, addToNative: true);
videoStream = newTrackStream;
sendProduce(
stream: newTrackStream,
codec: codec,
track: newTrack,
);
I've logged a bug with Flutter Web RTC https://github.com/flutter-webrtc/flutter-webrtc/issues/1020
I'm disabling and re-enabling the stream
Calling producer close, then converting the transport to producer again with a new stream.
The other device seems to get the original stream, but when switching it becomes a grey screen.
I have also tried re-initializing the WebRTC render and consumers, no luck.
Can't seem to find it in the example (Provider would be better than Bloc 🙈)