Browse Source

webrtc: prevent NotReadableError when publishing with Android (#2698) (#2842)

pull/2843/head
Alessandro Ros 2 years ago committed by GitHub
parent
commit
1feeba92b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      internal/servers/webrtc/publish_index.html

10
internal/servers/webrtc/publish_index.html

@ -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) => {
return Promise.all([
populateDevices(), populateDevices(),
populateCodecs(), populateCodecs(),
])) ])
.then(() => { .then(() => {
// free the webcam to prevent 'NotReadableError' on Android
stream.getTracks()
.forEach(track => track.stop());
state = DEVICE; state = DEVICE;
render(); render();
});
}) })
.catch((err) => { .catch((err) => {
state = ERROR; state = ERROR;

Loading…
Cancel
Save