2

Is there a way to hide/remove the Camera icon that appears in the address bar after we have stopped using it?

I am using OpenTok for Video Conferencing and using

OT.getUserMedia()
    .then(options=>{
        options.getTracks().forEach(track=>{
            track.stop();
        });
    })

I have also tried the code below

$window.navigator.mediaDevices.getUserMedia({ audio: true, video: true })
    .then(streams=> {
        streams.getTracks().forEach(track=>{
            track.stop();
        });
    })

But for some reason, the Camera icon does not disappear from the address bar, suggesting that recording is still taking place.

zohaib
  • 21
  • 1
  • 2
    Depending on the browser that may just be the permission icon, and cannot be hidden. For instance [_"In Firefox, for example, the URL bar displays a pulsing red icon to indicate that recording is underway. The icon is gray if the permission is in place but recording is not currently underway."_](https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia#User_privacy) – Patrick Evans May 31 '18 at 16:30
  • I am using Chrome. And I am pretty sure the camera is active. The icon says "Camera and microphone access allowed" However, since my application is a single page application, once I have used the camera, the icon appears on every subsequent route the user goes to. I am curious if there is a way to remove the icon once we have stopped recording. – zohaib May 31 '18 at 16:32
  • Doesn't really matter which browser all are required to have an indicator for recording and for permission. So either way you are always going to have some type of icon while the user has granted media access – Patrick Evans May 31 '18 at 16:34
  • The only way to remove it would be to revoke the permission, which I don't think you can do programmatically (yet), it currently is a user only action. – Patrick Evans May 31 '18 at 16:38
  • Ahh. Got it. Thanks. – zohaib May 31 '18 at 16:41

2 Answers2

0

TokBox Developer Evangelist here.

Since OT.getUserMedia is build on top of navigator.getUserMedia, all of the user privacy rules from navigator.getUserMedia apply to OT.getUserMedia. As Patrick Evans mentioned, these permissions and rules are set at the browser level and each browser is required to display an indicator that shows that a camera or microphone is in use.

Manik
  • 1,427
  • 9
  • 17
-1

I'm not familiar with OpenTok myself, but their docs seem reasonably good.

Have you tried hiding it using the setStyle method, as documented here? https://tokbox.com/developer/sdks/js/reference/Publisher.html#setStyle

You could also try to hide it via CSS display: none; if you can figure out an ID or class name identifier for that video button.

Protozoid
  • 1,192
  • 1
  • 7
  • 16