AdapterJS icon indicating copy to clipboard operation
AdapterJS copied to clipboard

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

Open santinoDu opened this issue 5 years ago • 1 comments

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 avatar Sep 06 '19 07:09 santinoDu

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

santinoDu avatar Oct 10 '19 03:10 santinoDu