-
Notifications
You must be signed in to change notification settings - Fork 156
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 ? #380
Comments
I have an open issue on this topic (#172); I currently have my own native implementation of PIP for my own app. |
Can you guide me or help me with some example or approach to accomplish this? Please help |
I created a React Native Android native module based on their docs: Note that I made this a while ago, so the above docs may show you a better/more recommended way, but my current solution (shown below) still works. I called my module PipModule. In my MainApplication.java, I add this package to the getPackages() method:
I created a PipModule.java file in the same directory as MainApplication.java:
And also a PipPackage.java file, in the same directory:
I can then use this native module in my JavaScript code, first by importing a few things from
And then in my OpenTok chat screen component, I have these for componentDidMount() and componentWillUnmount():
I define my _handleAppStateChange() method to save to state whether or not the app is backgrounded:
The final thing to do is to change my subscriber's width and height when backgrounded, so that it fits in the PIP window (optionally you can also shrink your publisher so that it's out of the way, but in my case it wasn't necessary):
|
Hi sunweiyang,
|
Thanks @sunweiyang |
has anyone integrated PIP in iOS/Android with opentok ? Just like WhatsApp...I have a requirement to keep the session active even if the user killed the app(swipe up) being a Publisher...
Any reference or suggestion would be really great
The text was updated successfully, but these errors were encountered: