Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Picture-in-picture support for backgrounded Android app #172

Open
sunweiyang opened this issue Sep 17, 2018 · 6 comments
Open

Picture-in-picture support for backgrounded Android app #172

sunweiyang opened this issue Sep 17, 2018 · 6 comments

Comments

@sunweiyang
Copy link

sunweiyang commented Sep 17, 2018

Feature Request

Description
Android picture-in-picture (PIP) multi-window mode lets the user continue to have an OpenTok video chat (most likely only the subscriber view is visible) pinned to a corner of the screen while navigating between different other apps.

Proposal
The opentok-react-native package's Android implementation can support picture-in-picture as an option. App backgrounding and app switching is an extremely common user behavior for video calling apps, and users' expectations are typically to continue the video call throughout these switches (i.e. checking their calendar/email for a quick item to tell their video call partner, etc.)

Links / references
https://developer.android.com/guide/topics/ui/picture-in-picture
https://tokbox.com/blog/android-picture-in-picture/

@msach22
Copy link
Contributor

msach22 commented Mar 5, 2019

@sunweiyang We should be able to add this in. Can you propose an API and how you would expect it to work? For example, should it be the publisher or the subscriber that we see when it goes into background mode. What happens when there are multiple subscribers?

@sunweiyang
Copy link
Author

Here is a proposal: by default, the PIP would show the first subscriber (if it exists), and if no subscribers exist, then the first publisher (if it exists). Otherwise, developers can also manually choose which publisher or subscriber to show, via an optional prop.

If no stream exists, or if no publisher or subscriber exists, or if the optional prop is null, then PIP would not be enabled.

@msach22
Copy link
Contributor

msach22 commented Mar 19, 2019

@sunweiyang Since PIP is not the default, I think it should be an opt in API.

pip={true} // default would be false
by default, the PIP would show the first subscriber (if it exists), and if no subscribers exist, then the first publisher (if it exists). 

This may get a bit confusing because what if you publish and also immediately subscribe then we would see some sort of. How about specifying explicitly which view you want to see in background mode?

@sunweiyang
Copy link
Author

@msach22 Yes, opt-in PIP and explicitly specifying the view to show in PIP both sound good, and is simpler.

@msach22
Copy link
Contributor

msach22 commented Mar 31, 2019

@sunweiyang To continue on this, do you think it should be a session level setting (like using a prop for OTSession)? This way we can always make sure they know if it's the publisher or the subscriber?

@sunweiyang
Copy link
Author

@msach22 I think you're right; an OTSession prop for defining the PIP view would make things more explicit, and it's something we would expect as a developer experience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants