1 year ago

#160478

test-img

Vinnie Amir

Turn flash/LEN on or off using JavaScript - works on Android, not iOS

The following code turns the torch/flash on or off using JavaScript inside browser.
VideoStream derived from navigator.mediaDevices.getUserMedia

VideoStream.applyConstraints({            advanced: [{ torch: state }]
                });

//Where VideoStream points to the camera stream/track, state = true (on) or false (off)

I have tested and works perfectly on Android, but on latest iOS it doesnt work. Can anyone tell me if there is a workaround/alternative, or is this a "live with it"?

javascript

ios

ios-camera

0 Answers

Your Answer

Accepted video resources