bambuser / BambuserPlayerSDK-Android

This project demonstrates how is the integration of Bambuser's Player SDK in an native Android application
Apache License 2.0
1 stars 1 forks source link

LVSPlayer.observeEvents should emit activity context #19

Closed SergioPoq closed 2 months ago

SergioPoq commented 5 months ago

If I want to navigate to a different activity when an event is triggered, for example, navigate to my own product detail page when OnProductHighlightClicked is triggered; I need to use an application context or leak an activity context meanwhile the player is active. For my use case, where I want to move the Bambuser player into picture in picture mode and navigate to my own product detail page, the application context does not work since my new activity will be shown inside the picture in picture stack. LVSPlayer.observeEvents should expose the event and the context of the Bambuser activity

SimovicIvan commented 3 months ago

The way I imagine solving this issue is: on event from sdk Activity, trigger PiP mode for sdk Activity. now you are back in your own activity and you can navigate without issues. And when you want to go back to sdk Activity, just maximize it again. In other words, our sdk Activity should not have anything to do with your navigation. Please give me more info on exactly what you are trying to do here if you still need help with this.

SergioPoq commented 3 months ago

I want to navigate to my own cart or product detail page and keep the video playing on PiP mode. For my particular use case, where I do not have a single Activity opening Bambuser but it can be opened from many different Activities in a generic way, handle the navigation from the previous activity is not a practical solution

SimovicIvan commented 3 months ago

LVSPlayer.observeEvents should expose the event and the context of the Bambuser activity

So each event we emit should have our activity context attached? or do you only need specific ones to do so?

SergioPoq commented 3 months ago

I would include the context for all events where users might want to navigate to a new activity. It's easier to use this context directly than handle the navigation from a previous activity. Also, I see no downsides of exposing this context.

SimovicIvan commented 3 months ago

@SergioPoq Did you also report a issue where the audio keeps playing even after closing the sdk PiP? looking at the code if the activities onStop is called the video is paused and onDestroyed the video is cleared. And onDestroy happens for me when I close the SDK PiP. Can you check on your side what exactly happens, and if you could destroy the Activity your self when you close PiP? I dont fully understand how you are using the SDK, but I do know that you do have to destroy the Activity when closing the PiP, and our own PiP implementation does that out of the box.

SergioPoq commented 3 months ago

Did you also report a issue where the audio keeps playing even after closing the sdk PiP?

No, I did not.

SimovicIvan commented 2 months ago

Fixed in release 1.3.0