diff --git a/RELEASENOTES.md b/RELEASENOTES.md
index 4d1ee1509d..c03ab052b7 100644
--- a/RELEASENOTES.md
+++ b/RELEASENOTES.md
@@ -88,6 +88,8 @@
* Don't propagate `AttributeSet` from `SubtitleView` constructor into
`CanvasSubtitleOutput`. Just passing the `Context` is enough, and
ensures programmatic changes to the `SubtitleView` will propagate down.
+ * Add `setUseRewindAction` and `setUseFastForwardAction` to
+ `PlayerNotificationManager`.
* Video:
* Fix `IncorrectContextUseViolation` strict mode warning on Android 11
([#8246](https://github.com/google/ExoPlayer/pull/8246)).
diff --git a/library/ui/src/main/java/com/google/android/exoplayer2/ui/PlayerNotificationManager.java b/library/ui/src/main/java/com/google/android/exoplayer2/ui/PlayerNotificationManager.java
index 49f88362c9..e030efe184 100644
--- a/library/ui/src/main/java/com/google/android/exoplayer2/ui/PlayerNotificationManager.java
+++ b/library/ui/src/main/java/com/google/android/exoplayer2/ui/PlayerNotificationManager.java
@@ -86,26 +86,26 @@ import java.util.Map;
*
Corresponding setter: {@link #setUsePlayPauseActions(boolean)}
* Default: {@code true}
*
- * {@code rewindIncrementMs} - Sets the rewind increment. If set to zero the rewind
- * action is not used.
+ * {@code useRewindAction} - Sets whether the rewind action is used.
*
- * - Corresponding setter: {@link #setControlDispatcher(ControlDispatcher)}
- *
- Default: {@link DefaultControlDispatcher#DEFAULT_REWIND_MS} (5000)
+ *
- Corresponding setter: {@link #setUseRewindAction(boolean)}
+ *
- Default: {@code true}
*
- * {@code useRewindActionInCompactView} - Sets whether the rewind action should be
- * shown in compact view mode.
+ * {@code useRewindActionInCompactView} - If {@code useRewindAction} is {@code true},
+ * sets whether the rewind action is also used in compact view (including the lock screen
+ * notification). Else does nothing.
*
* - Corresponding setter: {@link #setUseRewindActionInCompactView(boolean)}
*
- Default: {@code false}
*
- * {@code fastForwardIncrementMs} - Sets the fast forward increment. If set to zero the
- * fast forward action is not used.
+ * {@code useFastForwardAction} - Sets whether the fast forward action is used.
*
- * - Corresponding setter: {@link #setControlDispatcher(ControlDispatcher)}
- *
- Default: {@link DefaultControlDispatcher#DEFAULT_FAST_FORWARD_MS} (15000)
+ *
- Corresponding setter: {@link #setUseFastForwardAction(boolean)}
+ *
- Default: {@code true}
*
- * {@code useFastForwardActionInCompactView} - Sets whether the fast forward action
- * should be shown in compact view mode.
+ * {@code useFastForwardActionInCompactView} - If {@code useFastForwardAction} is
+ * {@code true}, sets whether the fast forward action is also used in compact view (including
+ * the lock screen notification). Else does nothing.
*
* - Corresponding setter: {@link #setUseFastForwardActionInCompactView(boolean)}
*
- Default: {@code false}
@@ -689,6 +689,8 @@ public class PlayerNotificationManager {
private boolean useNextAction;
private boolean usePreviousActionInCompactView;
private boolean useNextActionInCompactView;
+ private boolean useRewindAction;
+ private boolean useFastForwardAction;
private boolean useRewindActionInCompactView;
private boolean useFastForwardActionInCompactView;
private boolean usePlayPauseActions;
@@ -743,6 +745,8 @@ public class PlayerNotificationManager {
usePreviousAction = true;
useNextAction = true;
usePlayPauseActions = true;
+ useRewindAction = true;
+ useFastForwardAction = true;
colorized = true;
useChronometer = true;
color = Color.TRANSPARENT;
@@ -886,6 +890,30 @@ public class PlayerNotificationManager {
}
}
+ /**
+ * Sets whether the fast forward action should be used.
+ *
+ * @param useFastForwardAction Whether to use the fast forward action.
+ */
+ public void setUseFastForwardAction(boolean useFastForwardAction) {
+ if (this.useFastForwardAction != useFastForwardAction) {
+ this.useFastForwardAction = useFastForwardAction;
+ invalidate();
+ }
+ }
+
+ /**
+ * Sets whether the rewind action should be used.
+ *
+ * @param useRewindAction Whether to use the rewind action.
+ */
+ public void setUseRewindAction(boolean useRewindAction) {
+ if (this.useRewindAction != useRewindAction) {
+ this.useRewindAction = useRewindAction;
+ invalidate();
+ }
+ }
+
/**
* Sets whether the fast forward action should also be used in compact view. Has no effect if
* {@link #ACTION_FAST_FORWARD} is not enabled, for instance if the media is not seekable.
@@ -1300,7 +1328,7 @@ public class PlayerNotificationManager {
if (usePreviousAction && enablePrevious) {
stringActions.add(ACTION_PREVIOUS);
}
- if (enableRewind) {
+ if (useRewindAction && enableRewind) {
stringActions.add(ACTION_REWIND);
}
if (usePlayPauseActions) {
@@ -1310,7 +1338,7 @@ public class PlayerNotificationManager {
stringActions.add(ACTION_PLAY);
}
}
- if (enableFastForward) {
+ if (useFastForwardAction && enableFastForward) {
stringActions.add(ACTION_FAST_FORWARD);
}
if (useNextAction && enableNext) {