From 72cf9c3815cc5e71884c8b37392dd1d22a73b77c Mon Sep 17 00:00:00 2001 From: kimvde Date: Fri, 23 Jul 2021 08:25:39 +0100 Subject: [PATCH] Deprecate ControlDispatcher and DefaultControlDispatcher PiperOrigin-RevId: 386401066 --- RELEASENOTES.md | 2 ++ .../com/google/android/exoplayer2/ControlDispatcher.java | 9 ++------- .../android/exoplayer2/DefaultControlDispatcher.java | 3 ++- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 2d09298559..0d75f381ee 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -45,6 +45,8 @@ `Player.EVENT_MEDIA_METADATA_CHANGED` for convenient access to structured metadata, or access the raw static metadata directly from the `TrackSelection#getFormat()`. + * Deprecate `ControlDispatcher` and `DefaultControlDispatcher`. Use a + `ForwardingPlayer` or configure the player to customize operations. * Remove deprecated symbols: * Remove `Player.getPlaybackError`. Use `Player.getPlayerError` instead. * Remove `Player.getCurrentTag`. Use `Player.getCurrentMediaItem` and diff --git a/library/common/src/main/java/com/google/android/exoplayer2/ControlDispatcher.java b/library/common/src/main/java/com/google/android/exoplayer2/ControlDispatcher.java index 02eb54c756..a24131e956 100644 --- a/library/common/src/main/java/com/google/android/exoplayer2/ControlDispatcher.java +++ b/library/common/src/main/java/com/google/android/exoplayer2/ControlDispatcher.java @@ -17,13 +17,8 @@ package com.google.android.exoplayer2; import com.google.android.exoplayer2.Player.RepeatMode; -/** - * Dispatches operations to the {@link Player}. - * - *

Implementations may choose to suppress (e.g. prevent playback from resuming if audio focus is - * denied) or modify (e.g. change the seek position to prevent a user from seeking past a - * non-skippable advert) operations. - */ +/** @deprecated Use a {@link ForwardingPlayer} or configure the player to customize operations. */ +@Deprecated public interface ControlDispatcher { /** diff --git a/library/common/src/main/java/com/google/android/exoplayer2/DefaultControlDispatcher.java b/library/common/src/main/java/com/google/android/exoplayer2/DefaultControlDispatcher.java index 2af71da50f..b20daebefb 100644 --- a/library/common/src/main/java/com/google/android/exoplayer2/DefaultControlDispatcher.java +++ b/library/common/src/main/java/com/google/android/exoplayer2/DefaultControlDispatcher.java @@ -18,7 +18,8 @@ package com.google.android.exoplayer2; import static java.lang.Math.max; import static java.lang.Math.min; -/** Default {@link ControlDispatcher}. */ +/** @deprecated Use a {@link ForwardingPlayer} or configure the player to customize operations. */ +@Deprecated public class DefaultControlDispatcher implements ControlDispatcher { private final long rewindIncrementMs;