-
-
Notifications
You must be signed in to change notification settings - Fork 312
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
Handle app phases (auto pause/play on enter background/active phase) #831
Conversation
b82fb39
to
f878efa
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice to be able to control this as an option in the settings.
In particular, the part that unpause when you return to the foreground can be an uncomfortable experience for some users.
Yes totally agree with you @PangMo5. Some example I think about:
|
I agree that this should be customizable, so for now I want 2 new keys under a new section: // SwiftfinDefaults.swift
extension Defaults.Keys {
enum VideoPlayer {
// ...
enum Transition {
static let pauseOnBackground // ...
static let playOnActive // ...
}
}
} This will go in a new I have already thought about a more comprehensible solution for actions that will completely replace this, but frankly I don't know when I will get to it and will probably need to think about it more. It also may be sooner than expected when I get to it as this is fresh on my mind so 🤷. So, you can either implement these settings for now or wait until I get to it, your choice. [what I thought of]Similar to how the video player gestures and action buttons work, there will be a certain set of actions created (play, pause, PiP) that can be selected per Additionally, we have to think about this behavior with the |
baa4185
to
869ce2e
Compare
869ce2e
to
8b1b9af
Compare
Hi!
I noticed that when watching a movie on iOS, if I go back to Home Screen without pausing the movie then the movie juste continue playing in background.
This PR adds notification support for active, inactive and background phases of the app and also pause the video when app enter in background and resume the movie when enter in active phase.
This is still a first step, I guess other things can be done about that like stopping instead of pausing for live TV.
@LePips and @jhays if you can have a look on this, I'm a newbie on all the swift and Objective-C stuff...
Thank you!