Camera Automatically Turns Off with Permission Error on iPad Safari 15.6.1

Description

  • Upon joining a meeting session, my camera starts but turns off after 1-2 seconds, throwing the following error: ‘Unhandled Promise Rejection: NotAllowedError: The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission.’

  • However, if I manually toggle the camera off and on again, the video works as expected. Could this behavior be related to this issue: google chrome - Browser denying javascript play() - Stack Overflow)

This is my sessionId: ‘bt+wmOHzTQ6otjuvI+yd/w==’

Which Web Video SDK version?
1.11.10

Video SDK Code Snippets

      let videoOptions = {
        cameraId: cameraId,
        hd: state.mediaStream.isSupportHDVideo(),
        originalRatio: window.isMobile
      };

      if (state.mediaStream.isSupportVirtualBackground() && virtualBackground) {
        videoOptions.virtualBackground = { imageUrl: virtualBackground };
      }
      await state.mediaStream.startVideo(videoOptions);
state.mediaStream.attachVideo(participants[0].userId, 3).then((userVideo) => {
  document.querySelector('video-player-container').appendChild(userVideo);
})

Screenshots

Device:

  • Device: Ipad Air 2
  • OS: 15.6.1
  • Browser: Safari

Hey @lmtruong1512

Thanks for your feedback.

Yes. We recommend starting audio or video after the user interacts with the page.

Thanks
Vic

@vic.yang Thank you for your response.

In apps like Zoom or Google Meet, users can set their camera and microphone states on the preview screen, and when joining the meeting, these settings are applied automatically without additional interaction. For example, if the video is enabled during the preview, the camera starts automatically when the meeting begins. How can I achieve this behavior?

Thank you for your suggestion!

Hey @lmtruong1512

It’s feasible to use the same way as Zoom or Google Meet web client, but the premise is that the preview page and the meeting page are the same page (without the page being refreshed).

Thanks
Vic

1 Like