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

[FR] play in floating window #154

Closed
ildar opened this issue Nov 25, 2019 · 6 comments
Closed

[FR] play in floating window #154

ildar opened this issue Nov 25, 2019 · 6 comments
Labels
enhancement New feature or request

Comments

@ildar
Copy link

ildar commented Nov 25, 2019

as other video player do: NewPipe, VLC,...


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@sschueller sschueller added the enhancement New feature or request label Jun 1, 2020
@dhk2
Copy link
Contributor

dhk2 commented Jun 20, 2020

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.

@sschueller
Copy link
Owner

sschueller commented Jun 20, 2020

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.

@dhk2
Copy link
Contributor

dhk2 commented Jun 21, 2020

makes sense.

@dhk2
Copy link
Contributor

dhk2 commented Jun 21, 2020

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.

@dhk2
Copy link
Contributor

dhk2 commented Jun 23, 2020

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.

@sschueller
Copy link
Owner

@dhk2 Your addition is in release v1.0.39. Thanks, closing this for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants