Recovering app after Camera OFF / ON

If my camera is ON when my app is started, the layers work fine. Once I turn camera OFF and then ON, I loose any content on the Camera and the app is not automatically reloaded in Camera. I think I am missing something simple. Any ideas?

In my experience, enabling and disabling the camera synced with the drawn participant when using the layers API. Can you send a screenshot depicting what’s happening?

Also, does this only happen when the participant is using a mobile device?

Actually it’s not the draw participant that’s the issue. Here is what would cause the problem:

  • start the app while camera is on
  • my app launches and I am able to draw participant and webview etc
  • now user turns the zoom camera off, everything goes
  • now user turns camera on. My layers are gone in Camera, but the app is still running in sidebar

I even have a message call from sidebar app to show webview. But that goes nowhere it seems. I think the camera side app is not restarted and was not running while user had camera off.

Hope that clarifies the question.

I have the same issue. When the user turns off the camera and then turns it on any subsequent call to “drawImage” etc fails.

If I call runRenderingContext is says that is already setup

If I closeRenderingContext and then runRenderingContext I can get subsequent drawImage to work but only after a long time (wait for around 10s)

The solution is that closeRenderingContext needs to be called when the video is turned off and then runRenderingContext called again when the video is turned on.
The render is a bit slow (takes a few seconds to show) but it works.

2 Likes

Thanks for the response @henry2

Does this have to be done on the Camera side or Meeting side or both? Do I need to again initialize with drawWebView and register onMessage calls? It is quite hard to see what is happening on the Camera side, without inspect element access there, so any more details would be very helpful

I did the closeRenderingContext on the controller side. My code is similar to the code below. I keep track of whether the code is in the controller or camera with controllerMode flag. FYI - I am writing this within a Vue.js component hence the flags such as controllerMode being part of this

zoomSdk.onMyMediaChange((event) => {
  if (event.media.video.state) {
    // If camera render has not been started do so
    if(this.controllerMode && !this.cameraInitialized) {
       zoomSdk.runRenderingContext({view: 'camera'}).then((ctx) => {
            this.cameraInitialized = true
            res(ctx)
        }).catch(rej)
      }
  } else {
     // If camera render has been started then close it
      if(this.controllerMode && this.cameraInitialized) {
          zoomSdk.closeRenderingContext().then((ctx) => {
            this.cameraInitialized = false
            res(ctx)
          }).catch(rej)
        }
  }
})

HI! Make sure that the content is being properly displayed on the camera when it is turned on for the first time. If the content is not being displayed correctly when the camera is first turned on, there may be an issue with the way it is being rendered or displayed.