forked from External/mediamtx
This commit is contained in:
parent
e6fec31516
commit
1feeba92b0
1 changed files with 13 additions and 7 deletions
|
|
@ -717,13 +717,19 @@ const initialize = () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
navigator.mediaDevices.getUserMedia({ video: true, audio: true })
|
navigator.mediaDevices.getUserMedia({ video: true, audio: true })
|
||||||
.then(() => Promise.all([
|
.then((stream) => {
|
||||||
populateDevices(),
|
return Promise.all([
|
||||||
populateCodecs(),
|
populateDevices(),
|
||||||
]))
|
populateCodecs(),
|
||||||
.then(() => {
|
])
|
||||||
state = DEVICE;
|
.then(() => {
|
||||||
render();
|
// free the webcam to prevent 'NotReadableError' on Android
|
||||||
|
stream.getTracks()
|
||||||
|
.forEach(track => track.stop());
|
||||||
|
|
||||||
|
state = DEVICE;
|
||||||
|
render();
|
||||||
|
});
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
state = ERROR;
|
state = ERROR;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue