I am trying to turn off the connected MacBook webcam and cam-led lighting safari browser.
Here is my code
myStream[0].getVideoTracks().forEach(track => track.stop())
It works on Chrome but doesn't in Safari.
How do you turn off the green light of the webcam? I looked at this part:
https://developer.mozilla.org/ko/docs/Web/API/MediaStreamTrack/stop
CodePudding user response:
If we keep aside the ethical side of this question, I believe the green light of the webcam is hardware controlled and not software controlled on latest MacBook. Some additional information here https://apple.stackexchange.com/questions/313504/does-a-modern-macbooks-green-camera-light-always-turn-on-when-the-camera-is-a/396129
CodePudding user response:
We can't turn off mac webcam greenlight manually if the webcam isn't turned off anymore according to apple's new policy. It will turn off if the webcam is not in use