Closed ildar closed 4 years ago
Got this working on my test system. There's some Android version specific code that will require more testing on various versions though. Adding a button was being difficult so I put switching to floating mode on a longpress of the full screen button.
Got this working on my test system. There's some Android version specific code that will require more testing on various versions though. Adding a button was being difficult so I put switching to floating mode on a longpress of the full screen button.
Ideally I would like this to function like the youtube app (with background play enabled). While playing the video it can be dragged down and continues to play at the bottom or if the back button is pressed the same happens. If one suspends the app the video runs in a floating window which can be dragged around. The floating window would not occur if the background play options is disabled.
makes sense.
I'm about 80% of the way there. In order to keep orphaned floating windows from happening when opening different videos I had to change the #launchmode of videoplayactivity in the manifest from "singletop" to "singletask". Everything seems to be working properly after the change. I can't see a need for multiple instances of the video player activity, but I might be missing something.
Of course, after creating the pull request I figured out that switching it to singleinstance allows me to fix the problem where the back button went back to home screen instead of video list after restoring from PIP mode. If the video list is destroyed while in PIP mode it will reopen the default view on backpress now. Youtube is able to keep the full back stack due to using fragments so the fragment manager keeps track even if the activity goes away. That would require a degree of re-architecting I'm not ready for yet :) I think I've figured out how the get the video to play at the bottom of the screen without using PIP mode, now to see if I can duplicate it.
@dhk2 Your addition is in release v1.0.39. Thanks, closing this for now.
as other video player do: NewPipe, VLC,...