-
Notifications
You must be signed in to change notification settings - Fork 155
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
Android: How to overlap/overlay publisher view over subscriber view? #122
Comments
@sunweiyang I have the same exact issue but it only occurs on Android, on iOS the absolute positioning of the publisher works well. |
@jonathanwmaddison thanks, I can also confirm that absolute positioning of publisher works on iOS. I've figured out that on Android, for a normal 2-user OpenTok session, the subscriber is currently always rendered on top of the publisher. I've observed that the publisher view instantiates and definitely exists for Android, but is simply covered up by the subscriber view. Unfortunately, defining Does anyone have a working Android solution for this? Edit: I suspect that it's because this library's Android implementation uses FrameLayouts, which are rendered in the order that the views are added. The publisher view is usually first to be created, so when the subscriber view is added after, it covers up the publisher view that's already there. This requires a native-side solution. |
@sunweiyang Have you found any way around this issue? I haven't dug into the native android implementation since Android is currently lower on our priority list. |
@jonathanwmaddison Since we also have limited development resources, for now we have simply fallen back on pure Android native (before we began using opentok-react-native). This is currently the main blocker for us from using opentok-react-native in Android. If/when this issue is resolved, we'll immediately update our Android codebase for opentok-react-native. |
Hi, I have the same issue as yours and I found a solution from the android SDK |
@sunweiyang @jonathanwmaddison @rockyip Thanks for sharing your findings. I will check this out and get back to you all soon! |
You should draw the publisher again when the subscriber is viewed (so in two case: when the is connecting and when the subscriber is streaming
|
Thanks @asatour but my app needs a modal already for other purposes, and RN currently does not support multiple simultaneous modals: A true solution for overlapping publisher still needs to be found that does not use modals. |
@sunweiyang
|
@sunweiyang Sorry for the delay on this, I'll add a PR to fix this and release hopefully by today! |
@sunweiyang @asatour @jonathanwmaddison @emin93 @sandrotiiago This has been fixed and released with |
BTW, this was my code that I used to test:
|
<OTSession |
We need to use
opentok-react-native
to create overlapping views on the same screen (publisher thumbnail over subscriber).Here is an example screen of what we need:
We've tried to use
position: absolute
styling, but this fails to render properly:The straightforward non-overlapping implementation (like in
opentok-react-native-samples
) renders as expected.How can our desired overlap/overlay of
OTPublisher
on top ofOTSubscriber
be accomplished?The text was updated successfully, but these errors were encountered: