Skip to content

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

@santinoDu

Description

@santinoDu

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions