-
Notifications
You must be signed in to change notification settings - Fork 721
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ahoyapps 495 switch camera #152
Conversation
@@ -35,7 +35,8 @@ export default function VideoTrack({ track, isLocal, priority }: VideoTrackProps | |||
}, [track, priority]); | |||
|
|||
// The local video track is mirrored. | |||
const style = isLocal ? { transform: 'rotateY(180deg)' } : {}; | |||
const isFrontFacing = track.mediaStreamTrack.getSettings().facingMode !== 'environment'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about track.mediaStreamTrack.getSettings().facingMode === 'user';
? Because if facingMode is left
or right
, this evaluates to true.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
facingMode
is a property that seems to exist only on mobile devices. So isFrontFacing
would be false
when using the app on my laptop, and the video would not be mirrored when it should be.
Also, according to MDN, facingMode of left
and right
represents cameras that are front facing, just pointed over the user's left or right shoulder. I can't think of any devices with these cameras, but we would want isFrontFacing
to be true
in those cases.
…-video-app-react into AHOYAPPS-495-switch-camera
Ahoyapps 495 switch camera (twilio#152)
* create FlipCameraButton component and add to menubar * Pass facingMode to GetLocalVideoTracks * Only mirror video when front-facing * Add low priority to video publish * Add comment * Fix tests * Add tests for FlipCameraButton * Rename variable * Update comment
Contributing to Twilio
Pull Request Details
JIRA link(s):
Description
This PR adds an icon that allows mobile users to toggle between their front and rear facing cameras. Users can do this before or after they join a room.
Burndown
Before review
npm test
Before merge