mirror of
https://github.com/androidx/media.git
synced 2025-05-04 22:20:47 +08:00
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
This commit is contained in:
parent
5ce0c6fead
commit
b04ec2190b
@ -4,6 +4,8 @@
|
||||
|
||||
* Match codecs starting with "mp4a" to different Audio MimeTypes
|
||||
([#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 ###
|
||||
|
||||
|
@ -77,11 +77,10 @@ public class DefaultPlaybackController implements MediaSessionConnector.Playback
|
||||
public long getSupportedPlaybackActions(Player player) {
|
||||
if (player == null || player.getCurrentTimeline().isEmpty()) {
|
||||
return 0;
|
||||
} else if (!player.isCurrentWindowSeekable()) {
|
||||
return BASE_ACTIONS;
|
||||
}
|
||||
long actions = BASE_ACTIONS;
|
||||
if (player.isCurrentWindowSeekable()) {
|
||||
actions |= PlaybackStateCompat.ACTION_SEEK_TO;
|
||||
}
|
||||
long actions = BASE_ACTIONS | PlaybackStateCompat.ACTION_SEEK_TO;
|
||||
if (fastForwardIncrementMs > 0) {
|
||||
actions |= PlaybackStateCompat.ACTION_FAST_FORWARD;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user