Switch between multiple cameras in mozilla Firefox browser

Viewed 2136

I have multiple cameras connected with my pc.

When I run my HTML page I have the list of camera's when I switch from camera1 to camera2 It is working fine in google chrome browser. But in Firefox I can't able to change the stream of the local video tag.

Here is my working code in chrome.

// This is My HTML tag

    <video id="s-video" height="20%" width="15%" class="sub_video" autoplay="autoplay"></video>

// Javascript code

    navigator.mediaDevices.getUserMedia({video: {deviceId: camera}})
    .then(function(stream) {

        // I also get camera ID Hear in alert
        // svideo is video tag with autoplay enabled

        svideo = document.getElementById('s-video');
        svideo.srcObject = stream;
    });

Now, This Code is working in chrome but when I run this page in Firefox browser It is not changing stream even I select a camera from Firefox's permission tab.

My Firefox version is : Firefox Quantum 64.0b11 (64-bit)

OS: Ubuntu 16.04

Thanks in advance

1 Answers
Related