Skip to content

Commit

Permalink
Always use user provided fast forward and rewind values
Browse files Browse the repository at this point in the history
  • Loading branch information
nielsvanvelzen committed Aug 20, 2023
1 parent 51938cd commit 1c427e8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,8 @@ class SocketHandler(
PlaystateCommand.SEEK -> playbackController?.seek(
(message.request.seekPositionTicks ?: 0) / TICKS_TO_MS
)
// FIXME get rewind/forward amount from displayprefs
PlaystateCommand.REWIND -> playbackController?.skip(REWIND_MS)
PlaystateCommand.FAST_FORWARD -> playbackController?.skip(FORWARD_MS)
PlaystateCommand.REWIND -> playbackController?.rewind()
PlaystateCommand.FAST_FORWARD -> playbackController?.fastForward()
}
}

Expand Down Expand Up @@ -196,7 +195,5 @@ class SocketHandler(

companion object {
const val TICKS_TO_MS = 10000L
const val REWIND_MS = -11000
const val FORWARD_MS = 30000
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -497,10 +497,10 @@ else if (mSelectedProgramView instanceof GuideChannelHeader)
mPlaybackController.playPause();
return true;
} else if (keyCode == KeyEvent.KEYCODE_MEDIA_FAST_FORWARD || keyCode == KeyEvent.KEYCODE_BUTTON_R1 || keyCode == KeyEvent.KEYCODE_BUTTON_R2) {
mPlaybackController.skip(30000);
mPlaybackController.fastForward();
return true;
} else if (keyCode == KeyEvent.KEYCODE_MEDIA_REWIND || keyCode == KeyEvent.KEYCODE_BUTTON_L1 || keyCode == KeyEvent.KEYCODE_BUTTON_L2) {
mPlaybackController.skip(-11000);
mPlaybackController.rewind();
return true;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1283,7 +1283,7 @@ public void onError(Exception exception) {
currentSkipPos = 0;
};

public void skip(int msec) {
private void skip(int msec) {
if (hasInitializedVideoManager() && (isPlaying() || isPaused()) && spinnerOff && mVideoManager.getCurrentPosition() > 0) { //guard against skipping before playback has truly begun
mHandler.removeCallbacks(skipRunnable);
refreshCurrentPosition();
Expand Down

0 comments on commit 1c427e8

Please sign in to comment.