Comments (8)
changedevice(videoinput,audioinput) {
this.setState({
videoinput:videoinput,
audioinput:audioinput
});
alert(this.state.videoinput);
console.log(this.state.videoinput,this.state.audioinput);
const op = {
video: {
width: { min: 160, ideal: 640, max: 1280 },
height: { min: 170, ideal: 360, max: 720 },
facingMode:this.state.videoinput
},
audio:{echoCancellation: true,
deviceId: this.state.audioinput}
};
navigator.getUserMedia(
op,
stream => {
stream.oninactive = () => {
Object.keys(this.state.peers).forEach((key)=>{
this.state.peers[key].removeStream(this.state.localStream);
})
this.getUserMedia().then(() => {
Object.keys(this.state.peers).forEach((key)=>{
this.state.peers[key].addStream(this.state.localStream);
})
});
};
this.setState({ streamUrl: stream, localStream: stream });
this.localVideo.srcObject = stream;
Object.keys(this.state.peers).forEach((key)=>{
this.state.peers[key].addStream(this.state.localStream);
})
},
() => { }
);
}
This is what I am trying but the video is getting an update. What is wrong with this code?? @diegogurgel @kevinjpuscan
from react-webrtc.
Could you please help me with this?? @diegogurgel @kevinjpuscan
from react-webrtc.
Are you saying that you have multiple devices connected to the computer and want to select them? Did I get it right?
from react-webrtc.
Yeah I am trying on smart phone also I can't switch between front and rear camera
from react-webrtc.
Do u have any solution?? @diegogurgel
from react-webrtc.
Maybe this piece of code can help you with selecting different sources https://github.com/samdutton/simpl/blob/gh-pages/getusermedia/sources/js/main.js
This is basically listing all devices available setting one as a source when you select.
from react-webrtc.
I can get the stream by device Id but i cannot set that to localstream and also not able to peer
from react-webrtc.
I can get the stream by device Id but i cannot set that to localstream and also not able to peer
Solved !!
from react-webrtc.
Related Issues (14)
- More than 2 video
- unhandled rejection (TypeError): navigator.getUserMEdia is not a function in mobile HOT 4
- Unable to establish conenction. HOT 1
- Username
- Establishing connection not working on diff devices HOT 3
- where localVideo?
- Add audio and vídeo controls
- Socket problem when deploying to Heroku HOT 1
- Hide share screen button on mobile
- Add fullscreen control
- Looking for contributors HOT 1
- Hi!! diegogurgel! i am your fan and i like your webrtc project so... i send you email and... i write here too about my problem HOT 7
- Not connecting clients from different networks HOT 7
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 react-webrtc.