ShareCanvas is not presenting any content before screen rotation

Hi team,

I have following code in our app that presents the share canvas from remote user:

internal fun ZoomScreenShareVideo(
    userId: String,
    onError: (Throwable) -> Unit,
    modifier: Modifier = Modifier
) {
    val isPreview = LocalInspectionMode.current
    if (isPreview) return

    val zoom = try {
        ZoomVideoSDK.getInstance()
    } catch (expected: Throwable) {
        onError(expected)
        return
    }
    val videoCanvas = zoom.findUser(userId)?.shareActionList?.firstOrNull()?.shareCanvas ?: return
    var subscribed by remember { mutableStateOf(false) }

    AndroidView(
        modifier = modifier,
        factory = { context ->
            ZoomVideoSDKVideoView(context).apply {
                setZOrderOnTop(false)
            }
        },
        update = { view ->
            if (!subscribed) {
                videoCanvas.subscribe(
                    view,
                    ZoomVideoSDKVideoAspect.ZoomVideoSDKVideoAspect_Original,
                    ZoomVideoSDKVideoResolution.ZoomVideoSDKResolution_Auto
                )
                subscribed = true
            } else {
                videoCanvas.setAspectMode(
                    view,
                    ZoomVideoSDKVideoAspect.ZoomVideoSDKVideoAspect_Original
                )
            }
        },
        onRelease = { view ->
            if (subscribed) {
                videoCanvas.unSubscribe(view)
            }
        }
    )
}

However after starting by remote user the screen sharing the share canvas is not displaying any content within ZoomVideoSDKVideoView . After rotating the phone the screen sharing starts to work.

Which Android:
2.1.5

Smartphone (please complete the following information):

  • Device: [e.g Motorola g52]
  • OS: [e.g. Android 13]

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.

Hi @jbialkowski Apologies for the wait. I will take a look at this and reach out to our engineers for some guidance.

1 Like

Hi @jbialkowski quick question: When rotating the screen, does screen sharing only work in landscape mode or does rotating the screen cause the screen share to work for both portrait and landscape? Also, if you stop and then reshare, does the screen share work from the start?