Camera flipping on Mobile devices
See original GitHub issueMoving https://github.com/versatica/mediasoup-demo/issues/16 to this repo.
Currently there is no way to flip a camera on a mobile device using mediasoup-client. I tried mediasoup-demo, and it didn’t work. The current workaround is to stop the tracks both on mediaStream and videoProducer:
Typescript example:
export const switchCamera = async (
videoDevicesCycle: Iterator<MediaDeviceInfo>,
videoStream: MediaStream,
videoProducer: any
): Promise<MediaStream> => {
const videoDevice = videoDevicesCycle.next().value
videoStream!.getVideoTracks()[0].stop()
videoProducer.track.stop()
videoStream = await getStream(
config.videoMediaStreamConstraints(videoDevice!.deviceId)
)
await videoProducer.replaceTrack(videoStream.getVideoTracks()[0])
return videoStream
}
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:11 (7 by maintainers)
Top Results From Across the Web
How to Stop iPhone Selfies From Flipping or Mirroring After ...
Open the Settings app and tap Camera. · Turn on the switch for Mirror Front Camera or Mirror Front Photos. · Open the...
Read more >The best pop up camera phones to buy in 2022
The best pop up camera phones. OnePlus 7T Pro; Oppo Reno 10x Zoom and Reno 2; Asus Zenfone 8 Flip; Lenovo Legion Duel...
Read more >How To Stop Your iPhone Camera From Flipping?
Open your Photos app on your phone; Select the picture that you need to flip · At the top left of the screen,...
Read more >iOS 14: How to Mirror Your Front Camera on iPhone
Launch the Settings app on your iPhone or iPad. · Scroll down and select Camera. · Toggle the switch next to Mirror Front...
Read more >Why does camera flip the picture when I take a selfie?
Hi! The image flips automatically to avoid the "mirror effect". If you look in the front camera from the app you see things...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
2.0.7 published and API documentation updated.
Will be done in this week.