flutter-webrtc / flutter-webrtc

WebRTC plugin for Flutter Mobile/Desktop/Web
MIT License
4.15k stars 1.13k forks source link

multiple webRTC replaceTrack() calls for swapping two video streams #654

Open heeyounglee opened 3 years ago

heeyounglee commented 3 years ago

I'm making a video call application with two video sources: camera / screen record, and let the users switch camera <-> screen record multiple times during a call. replaceTrack() allows me to replace the camera stream with the screen record stream.

But if I try to switch back to the camera stream, it doesn't work on ios. On android, if I use setTrack(x, takeOwnership=false), and it works ok. I wonder if I can do the same on ios.

cloudwebrtc commented 3 years ago

ReplaceTrack cannot be used in iOS. As far as I know, iOS cannot open the front and rear cameras at the same time, so please use Helper. switchCamera