SUPPORT.TWILIO.COM END OF LIFE NOTICE: This site, support.twilio.com, is scheduled to go End of Life on February 27, 2024. All Twilio Support content has been migrated to help.twilio.com, where you can continue to find helpful Support articles, API docs, and Twilio blog content, and escalate your issues to our Support team. We encourage you to update your bookmarks and begin using the new site today for all your Twilio Support needs.

Is It Possible to Capture the Device Lock Screen During a Session?

Question

Is it possible to capture the device lock screen on Android devices during Twilio Video sessions using the native SDK?

 

Product

Twilio Video

 

Answer

When the device screen locks during an active session, it is expected that the streamed video goes blank instead of showing the lock screen.

Even when disabling the FLAG_SECURE flag, it is expected Twilio Video's ScreenCapturer (via media projection) will terminate on screen lock. You can find more details in the Android docs related to media projection here.

Workarounds on this appear limited, and may require custom lock screens, device policy changes, or deep OEM modifications.

 

Additional Information 

You can find our ScreenCapturer docs and example code here for reference:

And as far as application backgrounding on Android generally, a Service can be used to manage the lifecycle of a Room:

You may want to reference this code from the Android quickstart for handling of putting the app in the background / foreground:

Have more questions? Submit a request
Powered by Zendesk