Temasys / AdapterJS

AdapterJS Javascript Polyfill and Tools for WebRTC - Skylink WebRTC
http://skylink.io/web
Other
432 stars 100 forks source link

IE11 refresh page fail to create video track (IE can't close camera) #309

Open santinoDu opened 5 years ago

santinoDu commented 5 years ago

ENV: IE11 , Edge

First time load page, EVERYTHING IS OK with navigator.mediaDevices.getUserMedia, video can play camera.

But when I refresh the page, navigator.mediaDevices.getUserMedia throw an error 'Failed to create video trackr' error name is 'ConstraintNotSatisfiedError'.

I thought the reason is IE does not close the camera when I refresh the page. So I added a listener

window.addEventListener('beforeunload', function () {
    if (stream) {
          // works fine
          stream.getTracks().forEach(track => {
            track.stop();
          });
        }
})

'stream' is getUserMedia resolve data. But can't work. Also, I found that the camera light is closed. But when I refresh the page , it still throw the error.

What can I do to make the camera fine when I refresh the page?

santinoDu commented 5 years ago

The pointer is can't close the camera in IE, any way can make this?