question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Camera flipping on Mobile devices

See original GitHub issue

Moving 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:closed
  • Created 6 years ago
  • Reactions:2
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

3reactions
ibccommented, Jan 22, 2018

2.0.7 published and API documentation updated.

1reaction
ibccommented, Jan 22, 2018

Will be done in this week.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found