Commit b04ec219 by bachinger Committed by Oliver Woodman

Omit fast forward and rewind actions when current window is not seekable

Issue: #4001

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=189722812
parent 5ce0c6fe
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
* Match codecs starting with "mp4a" to different Audio MimeTypes * Match codecs starting with "mp4a" to different Audio MimeTypes
([#3779](https://github.com/google/ExoPlayer/issues/3779)). ([#3779](https://github.com/google/ExoPlayer/issues/3779)).
* MediaSession extension: Omit fast forward and rewind actions when media is not
seekable ([#4001](https://github.com/google/ExoPlayer/issues/4001)).
### 2.7.1 ### ### 2.7.1 ###
......
...@@ -77,11 +77,10 @@ public class DefaultPlaybackController implements MediaSessionConnector.Playback ...@@ -77,11 +77,10 @@ public class DefaultPlaybackController implements MediaSessionConnector.Playback
public long getSupportedPlaybackActions(Player player) { public long getSupportedPlaybackActions(Player player) {
if (player == null || player.getCurrentTimeline().isEmpty()) { if (player == null || player.getCurrentTimeline().isEmpty()) {
return 0; return 0;
} else if (!player.isCurrentWindowSeekable()) {
return BASE_ACTIONS;
} }
long actions = BASE_ACTIONS; long actions = BASE_ACTIONS | PlaybackStateCompat.ACTION_SEEK_TO;
if (player.isCurrentWindowSeekable()) {
actions |= PlaybackStateCompat.ACTION_SEEK_TO;
}
if (fastForwardIncrementMs > 0) { if (fastForwardIncrementMs > 0) {
actions |= PlaybackStateCompat.ACTION_FAST_FORWARD; actions |= PlaybackStateCompat.ACTION_FAST_FORWARD;
} }
......
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