-
-
Notifications
You must be signed in to change notification settings - Fork 469
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extract existing callback logic into interface
Many call-backs already exist between the VideoManager and PlaybackController. But they are created on an ad-hoc basis in various methods. By extracting these out to a method it means we can: - Remove the boilerplate of @OverRide methods in PlaybackController - Easily refactor these into a seperate class long-term - Add new handlers - Pass parameters around in the future - Not have everything dispatch to a simple onEvent. This also makes extending the interface easier where we have exoplayer only notifications (such as onPlaybackSpeedChanged). Since the VLC code can simply call the notifier without going through a PlaybackListener
- Loading branch information
Showing
3 changed files
with
132 additions
and
125 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
app/src/main/java/org/jellyfin/androidtv/ui/playback/PlaybackControllerNotifiable.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package org.jellyfin.androidtv.ui.playback | ||
|
||
interface PlaybackControllerNotifiable { | ||
fun onCompletion() | ||
fun onError() | ||
fun onPrepared() | ||
fun onProgress() | ||
fun onPlaybackSpeedChange(newSpeed: Float) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters