Comments (4)
Thanks for the issue @praveshkhatana! Glad you could get this working on iOS.
Could you please provide a more complete complete code example? A link to a fork would be nice. It's difficult to figure out what the issue is without more context. I'd also be interested in how you got it working on iOS.
Thanks!
from twilio-video-app-react.
Hey @timmydoza Hope you doing great.
I was trying to modify the userLocalVideoTrack hook to flip the camera.
I have the same issue. Please find the below code.
`export function useLocalVideoTrack() {
const [track, setTrack] = useState();
const camFacing: CameraFacing = CAMERA === 'Front' ? 'Back' : 'Front';
const [cameraFacing, setCameraFacing] = useState(camFacing);
const getLocalVideoTrack = useCallback(
async () => {
const permissions = await navigator.mediaDevices.getUserMedia({audio: true, video: true});
const devices = await navigator.mediaDevices.enumerateDevices();
const videoDevices = devices.filter(d => d.kind === 'videoinput');
let videoPermissions = videoDevices.length > 1 && (CAMERA === 'Back' || CAMERA === null) ? {facingMode: 'user'} : {facingMode: 'environment'};
if (CAMERA === null) {
CAMERA = camFacing;
} else {
// alert(camFacing);
const camF = CAMERA !== 'Front' ? 'Front' : 'Back';
setCameraFacing(camF);
CAMERA = camF;
}
return Video.createLocalVideoTrack({
frameRate: 24,
height: 480,
width: 720,
facingMode: videoPermissions.facingMode,
name: 'camera'
}).then(newTrack => {
setTrack(newTrack);
return newTrack;
});
},
[]
);
useEffect(() => {
// We get a new local video track when the app loads.
getLocalVideoTrack();
}, [getLocalVideoTrack]);
useEffect(() => {
const handleStopped = () => setTrack(undefined);
if (track) {
track.on('stopped', handleStopped);
return () => {
track.off('stopped', handleStopped);
};
}
}, [track]);
return [track, getLocalVideoTrack, cameraFacing] as const;}
`
The above code is working perfect with IOS, but not on android phones.
from twilio-video-app-react.
Hey @timmydoza
I got fixed.
Thanks.
from twilio-video-app-react.
@praveshkhatana @bhargavgoli
We just added this feature to the master branch of our app. If you are interested, you can see changes in the PR here: #152
from twilio-video-app-react.
Related Issues (20)
- twilio-video upgrade HOT 1
- Second participant audio is not playing on first participant screen HOT 2
- WhiteBoard Feature HOT 2
- waiting room HOT 1
- document and present Capability HOT 1
- token generation failed overall but also succeeded intermittently. HOT 1
- Screen sharing audio capabilities and the ability to see your own shared content. HOT 1
- Error when attempting to build local server HOT 1
- The request body is undefined unless we add bodyParser or express.json
- Camera light remains open once user disconnects from the room HOT 6
- Using WebAudio - AudioWorkletProcessors to process Audio Data
- Transcribing calls
- Upgrade security of the app with a token from our server. Passcode gets in the way when the app is deployed. HOT 1
- what is the use of web sockets
- Passcode starting with number '0' causes a bad passcode error.
- A thumbs up appears in the middle of the screen... HOT 1
- Mac OS Safari Screen Sharing performance degrades during recording
- Refactoring of code smells
- can anyone tell me what is the issue in me code
- Download the attachement added in the chat
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from twilio-video-app-react.