5

I have an issue related with javascript and MediaStreamTrack. I can turn on the device flashlight but (in some devices) i can't turn off unless i would call to MediaStreamTrack stop. I can't call MediaStreamTrack stop because i have a local video and i let the user turn on or off the flashlight.

¿Someone has the same issue?

I let you here some code...

//bool mode: true or false
function changeFlashLight(mode) {
    var capabilities = track.getCapabilities();
    var advanced = {};
    if (capabilities["torch"]) {
        advanced.torch = mode;
    }
       ...
    track.applyConstraints({
        advanced: [advanced]
    });
}

Regards.

0 Answers0