Skip to content

Camera does not function on macOS #483

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
galzol72 opened this issue Mar 8, 2025 · 2 comments
Open

Camera does not function on macOS #483

galzol72 opened this issue Mar 8, 2025 · 2 comments
Assignees
Labels
cannot reproduce Unless we can reproduce this issue, we can't fix it. configuration issue

Comments

@galzol72
Copy link

galzol72 commented Mar 8, 2025

Describe the bug

The camera does not function in SafeExamBrowser (SEB) on macOS. However, when using Safari without SEB, the camera works normally—after prompting for permission and having it granted, the video appears.

Steps to reproduce the behavior:

Below is the code snippet. (We typically use our own WebRTC proctoring system; this is a simplified, minimal code)
Start Camera

<script> var stream = document.getElementById( "video" ); stream.setAttribute('autoplay', ''); stream.setAttribute('muted', ''); stream.setAttribute('playsinline', ''); function startVideo() { navigator.mediaDevices.getUserMedia({video:true}) .then((stream)=>{ document.getElementById("video").srcObject=stream; }) .catch((err)=>{ alert("Error: " + err.name + ": " + err.message); }); } </script>

Version Information:

  • macOS: Sonoma 14.6
  • SEB mac version: 3.5

Additional Context:

  • The SEB setting browserWindowWebView is set to 3
  • The JavaScript API is available, indicating that the modern WebView is in use.
  • OS-level permissions for both the camera and microphone are enabled for SEB.
  • The site is accessed via HTTPS.
  • The Info.plist file includes the following keys and descriptions:
    NSCameraUsageDescription
    This application requires camera access for exam monitoring.
    NSMicrophoneUsageDescription
    This application requires microphone access for exam monitoring.

Troubleshooting Steps and Error:

  • The camera permission for SEB was reset using tccutil in the terminal.
  • Upon restarting SEB, and clicking on "Start Camera", it prompted for camera access, which was granted.
  • However, the following error was encountered:

"Error: NotAllowedError: The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission."

@danschlet danschlet added cannot reproduce Unless we can reproduce this issue, we can't fix it. configuration issue labels Mar 9, 2025
@danschlet
Copy link
Member

danschlet commented Mar 9, 2025

As you can test with this link Jitsi Meet Test for getDisplayMedia: sebs://safeexambrowser.org/exams/JitsiScreenSharingTest.seb (link also on this page), camera and microphone access for web applications works perfectly with SEB 3.5.

I assume you didn't set the necessary options in Settings / Browser / Media Playback/Capture.

Image

@galzol72
Copy link
Author

galzol72 commented Mar 9, 2025

Thank you—it’s now working!

I discovered that I was creating our SEB configuration files using the Windows tool (version 3.9) for both Windows and macOS. I didn’t see the “Media autoplay”, “Allow camera capture”, and “Allow microphone capture” options in that tool (they’re visible in the Mac version). These options generate the following keys:

browserMediaAutoplay
browserMediaAutoplayAudio
browserMediaAutoplayVideo
browserMediaCaptureCamera
browserMediaCaptureMicrophone

Setting these keys allowed the camera to work on macOS.

I might have missed something in the documentation.

Thank you very much for your prompt help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cannot reproduce Unless we can reproduce this issue, we can't fix it. configuration issue
Projects
None yet
Development

No branches or pull requests

2 participants