Screen sharing is not working on Android after updating the Zoom Video SDK for React Native from version 1.13.11 to 2.2.5. It was working fine on the previous version. After the upgrade, I receive the system prompt to start screen sharing, but nothing happens when I click “Start”.
Errors
No explicit error message is thrown. The system prompt appears, but screen sharing does not start after tapping “Start”.
Which React Native Video SDK version?
2.2.5
await zoom.shareHelper.shareScreen()
To Reproduce (If applicable)
Use the Zoom Video SDK for React Native v2.2.5 on Android
Call shareHelper.shareScreen() during a meeting
Observe that the native Android prompt appears
Tap on “Start Now”
Nothing happens — screen sharing does not start
Troubleshooting Routes
Verified all native setup steps again as per documentation
Screen sharing was working perfectly on version 1.13.11
Retested on the same device/environment
Reviewed breaking changes in changelog, but found no relevant changes
Hi @sahil.saiyed If possible, can you include code snippets of your share screen logic? Do you get any events from the onShareCanvasSubscribeFail listener? Lastly, what type of content are you noticing this issue occurring?
I am seeing the same issue as sahil, although our Android app uses the Zoom Video SDK for Android (not the React Native for Android version). The issue started when upgrading our app from Video SDK 1.13.11 to Video SDK 1.14.0.
Our app has been able to successfully share the Android device’s screen for over a year. However, after updating to Video SDK 1.14.0, we are seeing the following:
Our Android app calls createScreenCaptureIntent() and starts the resulting Intent, which returns RESULT_OK.
Our Android app passes the result to startShareScreen(), which returns 0 (Errors_Success).
The onUserShareStatusChanged listener is called with shareAction.subscribeFailReason=null and shareAction.shareCanvas=null.
The other onUserShareStatusChanged listener is called with status=ZoomVideoSDKShareStatus_Start.
The other person on the video call (running Video SDK for web) sees a black rectangle appear.
The video of the Android screen never appears for the other person.
After a minute, the Video SDK for web reports an OPERATION_TIMEOUT error to the other person (makes sense, as the video of the Android screen never arrived).
Similar to sahil, we are not seeing any error messages in logcat on the Android side. There are no calls to any of the following listeners:
onError
onVideoCanvasSubscribeFail
onShareCanvasSubscribeFail (I checked both versions)
We tested our app with the following Video SDK versions:
1.10.11 - screen sharing works
1.12.10 - screen sharing works
1.13.5 - screen sharing works
1.13.11 - screen sharing works
1.14.0 - screen sharing is broken
2.1.10 - screen sharing is broken
2.2.10 - screen sharing is broken
I also tested the mobilertc-android sample app included with Video SDK 2.2.10, and screen sharing worked there. Thus, I assume that our app needs some update to allow screen sharing to function again. However, it’s unclear what update is needed, as none of the breaking changes in the Video SDK release notes seem to be related to the failure we are seeing.
This silent failure was really hard to track down, but we eventually found a workaround of adjusting the timing of our application. Our theory is that newer versions of the Zoom Video SDK for Android require us to wait until the foreground service is fully started before calling startShareScreen().
I posted a rough before/after approximation of our Android code below (MainActivity.kt). The only difference is delaying the startShareScreen() call via handler.post(). Perhaps there is a similar workaround usable for React-Native apps?
Code before:
private val handler = Handler(Looper.getMainLooper())
private val screenSharingLauncher = registerForActivityResult(StartActivityForResult()) { result ->
if (result.resultCode != Activity.RESULT_OK) {
showToast(R.string.zoom_screen_share_denied)
} else {
result.data?.let { data ->
val intent = Intent(AppContext, ZoomService::class.java)
AppContext.startForegroundService(intent)
val code = ZoomVideoSDK.getInstance().shareHelper.startShareScreen(data)
if (code != 0) {
showToast("Cannot share screen.")
AppContext.stopForegroundService(intent)
}
}
}
}
...
screenSharingLauncher.launch(getMediaProjectionManager().createScreenCaptureIntent())
Code after:
private val handler = Handler(Looper.getMainLooper())
private val screenSharingLauncher = registerForActivityResult(StartActivityForResult()) { result ->
if (result.resultCode != Activity.RESULT_OK) {
showToast(R.string.zoom_screen_share_denied)
} else {
result.data?.let { data ->
val intent = Intent(AppContext, ZoomService::class.java)
AppContext.startForegroundService(intent)
// Allow the service to start before starting screen sharing.
// If we don't, the screen sharing silently fails to start.
handler.post {
val code = ZoomVideoSDK.getInstance().shareHelper.startShareScreen(data)
if (code != 0) {
showToast("Cannot share screen.")
AppContext.stopForegroundService(intent)
}
}
}
}
}
...
screenSharingLauncher.launch(getMediaProjectionManager().createScreenCaptureIntent())