Commit f68fc3e7 by insun Committed by Oliver Woodman

Prevent buffering when clicking ffwd button at the end of stream

PiperOrigin-RevId: 329634001
parent 5b80eb8e
...@@ -1638,7 +1638,9 @@ public class StyledPlayerControlView extends FrameLayout { ...@@ -1638,7 +1638,9 @@ public class StyledPlayerControlView extends FrameLayout {
} }
if (event.getAction() == KeyEvent.ACTION_DOWN) { if (event.getAction() == KeyEvent.ACTION_DOWN) {
if (keyCode == KeyEvent.KEYCODE_MEDIA_FAST_FORWARD) { if (keyCode == KeyEvent.KEYCODE_MEDIA_FAST_FORWARD) {
controlDispatcher.dispatchFastForward(player); if (player.getPlaybackState() != Player.STATE_ENDED) {
controlDispatcher.dispatchFastForward(player);
}
} else if (keyCode == KeyEvent.KEYCODE_MEDIA_REWIND) { } else if (keyCode == KeyEvent.KEYCODE_MEDIA_REWIND) {
controlDispatcher.dispatchRewind(player); controlDispatcher.dispatchRewind(player);
} else if (event.getRepeatCount() == 0) { } else if (event.getRepeatCount() == 0) {
...@@ -1808,7 +1810,9 @@ public class StyledPlayerControlView extends FrameLayout { ...@@ -1808,7 +1810,9 @@ public class StyledPlayerControlView extends FrameLayout {
} else if (previousButton == view) { } else if (previousButton == view) {
controlDispatcher.dispatchPrevious(player); controlDispatcher.dispatchPrevious(player);
} else if (fastForwardButton == view) { } else if (fastForwardButton == view) {
controlDispatcher.dispatchFastForward(player); if (player.getPlaybackState() != Player.STATE_ENDED) {
controlDispatcher.dispatchFastForward(player);
}
} else if (rewindButton == view) { } else if (rewindButton == view) {
controlDispatcher.dispatchRewind(player); controlDispatcher.dispatchRewind(player);
} else if (playPauseButton == view) { } else if (playPauseButton == view) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment