From fa1bb32deba0ac8b1d6f9cc2c963bf0505d3927b Mon Sep 17 00:00:00 2001 From: kimvde Date: Mon, 19 Jul 2021 11:55:55 +0100 Subject: [PATCH] Remove deprecated `PlaybackPreparer` Also update release note to account for upcoming ControlDispatcher removal. PiperOrigin-RevId: 385520701 --- RELEASENOTES.md | 26 ++++++++++--------- .../android/exoplayer2/PlaybackPreparer.java | 25 ------------------ 2 files changed, 14 insertions(+), 37 deletions(-) delete mode 100644 library/common/src/main/java/com/google/android/exoplayer2/PlaybackPreparer.java diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 32aec06d6b..d2322fa157 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -51,15 +51,16 @@ `setPlaybackPreparer` methods will now call `Player.prepare` by default. If this behavior is sufficient, use of `PlaybackPreparer` can be removed from application code without replacement. For custom preparation logic, - replace calls to `setPlaybackPreparer` with calls to - `setControlDispatcher` on the same components, passing a - `ControlDispatcher` that implements custom preparation logic in - `dispatchPrepare`. Extend `DefaultControlDispatcher` to avoid having to - implement the other `ControlDispatcher` methods. + use a `ForwardingPlayer` that implements custom preparation logic in + `prepare`. * Remove `setRewindIncrementMs` and `setFastForwardIncrementMs` from UI - components. Use `setControlDispatcher` on the same components, passing a - `DefaultControlDispatcher` built using `DefaultControlDispatcher(long, - long)`. + components. These increments can be customized by configuring the + `Player` (see `setSeekBackIncrementMs` and `setSeekForwardIncrementMs` + in `SimpleExoPlayer.Builder`), or by using a `ForwardingPlayer` that + overrides `getSeekBackIncrement`, `seekBack`, `getSeekForwardIncrement` + and `seekForward`. The rewind and fast forward buttons can be disabled + by using a `ForwardingPlayer` that removes `COMMAND_SEEK_BACK` and + `COMMAND_SEEK_FORWARD` from the available commands. * Remove `PlayerNotificationManager` constructors and `createWith` methods. Use `PlayerNotificationManager.Builder` instead. * Remove `PlayerNotificationManager.setNotificationListener`. Use @@ -92,11 +93,12 @@ `PlayerNotificationManager`. * Remove `rewind_increment` and `fastforward_increment` attributes from `PlayerControlView` and `StyledPlayerControlView`. These increments can - be customized by configuring the `Player` (whenever possible) or by + be customized by configuring the `Player` (see `setSeekBackIncrementMs` + and `setSeekForwardIncrementMs` in `SimpleExoPlayer.Builder`), or by using a `ForwardingPlayer` that overrides `getSeekBackIncrement`, - `seekBack`, `getSeekForwardIncrement` and `seekForward`. The - corresponding buttons can be disabled by using a `ForwardingPlayer` - that removes `COMMAND_SEEK_BACK` and `COMMAND_SEEK_FORWARD` from the + `seekBack`, `getSeekForwardIncrement` and `seekForward`. The rewind and + fast forward buttons can be disabled by using a `ForwardingPlayer` that + removes `COMMAND_SEEK_BACK` and `COMMAND_SEEK_FORWARD` from the available commands. * Update `DefaultControlDispatcher` `getRewindIncrementMs` and `getFastForwardIncrementMs` to take the player as parameter. diff --git a/library/common/src/main/java/com/google/android/exoplayer2/PlaybackPreparer.java b/library/common/src/main/java/com/google/android/exoplayer2/PlaybackPreparer.java deleted file mode 100644 index 3ef38c8520..0000000000 --- a/library/common/src/main/java/com/google/android/exoplayer2/PlaybackPreparer.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (C) 2018 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.google.android.exoplayer2; - -/** @deprecated Use {@link ControlDispatcher} instead. */ -@Deprecated -public interface PlaybackPreparer { - - /** @deprecated Use {@link ControlDispatcher#dispatchPrepare(Player)} instead. */ - @Deprecated - void preparePlayback(); -}