Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
SDK
/
exoplayer
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
a264a0a0
authored
May 04, 2021
by
olly
Committed by
bachinger
May 04, 2021
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Remove deprecated UI methods
PiperOrigin-RevId: 371809078
parent
dd0981a5
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
14 additions
and
299 deletions
RELEASENOTES.md
extensions/mediasession/src/main/java/com/google/android/exoplayer2/ext/mediasession/MediaSessionConnector.java
library/common/src/main/java/com/google/android/exoplayer2/DefaultControlDispatcher.java
library/ui/src/main/java/com/google/android/exoplayer2/ui/PlayerControlView.java
library/ui/src/main/java/com/google/android/exoplayer2/ui/PlayerNotificationManager.java
library/ui/src/main/java/com/google/android/exoplayer2/ui/PlayerView.java
RELEASENOTES.md
View file @
a264a0a0
...
@@ -117,6 +117,16 @@
...
@@ -117,6 +117,16 @@
`ControlDispatcher`
that implements custom preparation logic in
`ControlDispatcher`
that implements custom preparation logic in
`dispatchPrepare`
. Extend
`DefaultControlDispatcher`
to avoid having to
`dispatchPrepare`
. Extend
`DefaultControlDispatcher`
to avoid having to
implement the other
`ControlDispatcher`
methods.
implement the other
`ControlDispatcher`
methods.
*
Remove
`setRewindIncrementMs`
and
`setFastForwardIncrementMs`
from UI
components. Use
`setControlDispatcher`
on the same components, passing
a
`DefaultControlDispatcher`
built using
`DefaultControlDispatcher(long, long)`
.
*
Remove
`PlayerNotificationManager`
constructors and
`createWith`
methods. Use
`PlayerNotificationManager.Builder`
instead.
*
Remove
`PlayerNotificationManager`
`setUseNavigationActions`
and
`setUseNavigationActionsInCompactView`
. Use
`setUseNextAction`
,
`setUsePreviousAction`
,
`setUseNextActionInCompactView`
and
`setUsePreviousActionInCompactView`
instead.
*
DRM:
*
DRM:
*
Only dispatch DRM session acquire and release events once per period
*
Only dispatch DRM session acquire and release events once per period
when playing content that uses the same encryption keys for both audio &
when playing content that uses the same encryption keys for both audio &
...
...
extensions/mediasession/src/main/java/com/google/android/exoplayer2/ext/mediasession/MediaSessionConnector.java
View file @
a264a0a0
...
@@ -552,32 +552,6 @@ public final class MediaSessionConnector {
...
@@ -552,32 +552,6 @@ public final class MediaSessionConnector {
}
}
/**
/**
* @deprecated Use {@link #setControlDispatcher(ControlDispatcher)} with {@link
* DefaultControlDispatcher#DefaultControlDispatcher(long, long)} instead.
*/
@SuppressWarnings
(
"deprecation"
)
@Deprecated
public
void
setRewindIncrementMs
(
int
rewindMs
)
{
if
(
controlDispatcher
instanceof
DefaultControlDispatcher
)
{
((
DefaultControlDispatcher
)
controlDispatcher
).
setRewindIncrementMs
(
rewindMs
);
invalidateMediaSessionPlaybackState
();
}
}
/**
* @deprecated Use {@link #setControlDispatcher(ControlDispatcher)} with {@link
* DefaultControlDispatcher#DefaultControlDispatcher(long, long)} instead.
*/
@SuppressWarnings
(
"deprecation"
)
@Deprecated
public
void
setFastForwardIncrementMs
(
int
fastForwardMs
)
{
if
(
controlDispatcher
instanceof
DefaultControlDispatcher
)
{
((
DefaultControlDispatcher
)
controlDispatcher
).
setFastForwardIncrementMs
(
fastForwardMs
);
invalidateMediaSessionPlaybackState
();
}
}
/**
* Sets the optional {@link ErrorMessageProvider}.
* Sets the optional {@link ErrorMessageProvider}.
*
*
* @param errorMessageProvider The error message provider.
* @param errorMessageProvider The error message provider.
...
...
library/common/src/main/java/com/google/android/exoplayer2/DefaultControlDispatcher.java
View file @
a264a0a0
...
@@ -29,9 +29,8 @@ public class DefaultControlDispatcher implements ControlDispatcher {
...
@@ -29,9 +29,8 @@ public class DefaultControlDispatcher implements ControlDispatcher {
private
static
final
int
MAX_POSITION_FOR_SEEK_TO_PREVIOUS
=
3000
;
private
static
final
int
MAX_POSITION_FOR_SEEK_TO_PREVIOUS
=
3000
;
private
final
Timeline
.
Window
window
;
private
final
Timeline
.
Window
window
;
private
final
long
rewindIncrementMs
;
private
long
rewindIncrementMs
;
private
final
long
fastForwardIncrementMs
;
private
long
fastForwardIncrementMs
;
/** Creates an instance. */
/** Creates an instance. */
public
DefaultControlDispatcher
()
{
public
DefaultControlDispatcher
()
{
...
@@ -168,24 +167,6 @@ public class DefaultControlDispatcher implements ControlDispatcher {
...
@@ -168,24 +167,6 @@ public class DefaultControlDispatcher implements ControlDispatcher {
return
fastForwardIncrementMs
;
return
fastForwardIncrementMs
;
}
}
/**
* @deprecated Create a new instance instead and pass the new instance to the UI component. This
* makes sure the UI gets updated and is in sync with the new values.
*/
@Deprecated
public
void
setRewindIncrementMs
(
long
rewindMs
)
{
this
.
rewindIncrementMs
=
rewindMs
;
}
/**
* @deprecated Create a new instance instead and pass the new instance to the UI component. This
* makes sure the UI gets updated and is in sync with the new values.
*/
@Deprecated
public
void
setFastForwardIncrementMs
(
long
fastForwardMs
)
{
this
.
fastForwardIncrementMs
=
fastForwardMs
;
}
// Internal methods.
// Internal methods.
private
static
void
seekToOffset
(
Player
player
,
long
offsetMs
)
{
private
static
void
seekToOffset
(
Player
player
,
long
offsetMs
)
{
...
...
library/ui/src/main/java/com/google/android/exoplayer2/ui/PlayerControlView.java
View file @
a264a0a0
...
@@ -667,32 +667,6 @@ public class PlayerControlView extends FrameLayout {
...
@@ -667,32 +667,6 @@ public class PlayerControlView extends FrameLayout {
}
}
/**
/**
* @deprecated Use {@link #setControlDispatcher(ControlDispatcher)} with {@link
* DefaultControlDispatcher#DefaultControlDispatcher(long, long)}.
*/
@SuppressWarnings
(
"deprecation"
)
@Deprecated
public
void
setRewindIncrementMs
(
int
rewindMs
)
{
if
(
controlDispatcher
instanceof
DefaultControlDispatcher
)
{
((
DefaultControlDispatcher
)
controlDispatcher
).
setRewindIncrementMs
(
rewindMs
);
updateNavigation
();
}
}
/**
* @deprecated Use {@link #setControlDispatcher(ControlDispatcher)} with {@link
* DefaultControlDispatcher#DefaultControlDispatcher(long, long)}.
*/
@SuppressWarnings
(
"deprecation"
)
@Deprecated
public
void
setFastForwardIncrementMs
(
int
fastForwardMs
)
{
if
(
controlDispatcher
instanceof
DefaultControlDispatcher
)
{
((
DefaultControlDispatcher
)
controlDispatcher
).
setFastForwardIncrementMs
(
fastForwardMs
);
updateNavigation
();
}
}
/**
* Returns the playback controls timeout. The playback controls are automatically hidden after
* Returns the playback controls timeout. The playback controls are automatically hidden after
* this duration of time has elapsed without user input.
* this duration of time has elapsed without user input.
*
*
...
...
library/ui/src/main/java/com/google/android/exoplayer2/ui/PlayerNotificationManager.java
View file @
a264a0a0
...
@@ -45,7 +45,6 @@ import android.support.v4.media.session.MediaSessionCompat;
...
@@ -45,7 +45,6 @@ import android.support.v4.media.session.MediaSessionCompat;
import
androidx.annotation.DrawableRes
;
import
androidx.annotation.DrawableRes
;
import
androidx.annotation.IntDef
;
import
androidx.annotation.IntDef
;
import
androidx.annotation.Nullable
;
import
androidx.annotation.Nullable
;
import
androidx.annotation.StringRes
;
import
androidx.core.app.NotificationCompat
;
import
androidx.core.app.NotificationCompat
;
import
androidx.core.app.NotificationManagerCompat
;
import
androidx.core.app.NotificationManagerCompat
;
import
androidx.media.app.NotificationCompat.MediaStyle
;
import
androidx.media.app.NotificationCompat.MediaStyle
;
...
@@ -660,152 +659,6 @@ public class PlayerNotificationManager {
...
@@ -660,152 +659,6 @@ public class PlayerNotificationManager {
private
boolean
useChronometer
;
private
boolean
useChronometer
;
@Nullable
private
String
groupKey
;
@Nullable
private
String
groupKey
;
/** @deprecated Use the {@link Builder} instead. */
@SuppressWarnings
(
"deprecation"
)
@Deprecated
public
static
PlayerNotificationManager
createWithNotificationChannel
(
Context
context
,
String
channelId
,
@StringRes
int
channelName
,
int
notificationId
,
MediaDescriptionAdapter
mediaDescriptionAdapter
)
{
return
createWithNotificationChannel
(
context
,
channelId
,
channelName
,
/* channelDescription= */
0
,
notificationId
,
mediaDescriptionAdapter
);
}
/** @deprecated Use the {@link Builder} instead. */
@Deprecated
public
static
PlayerNotificationManager
createWithNotificationChannel
(
Context
context
,
String
channelId
,
@StringRes
int
channelName
,
@StringRes
int
channelDescription
,
int
notificationId
,
MediaDescriptionAdapter
mediaDescriptionAdapter
)
{
NotificationUtil
.
createNotificationChannel
(
context
,
channelId
,
channelName
,
channelDescription
,
NotificationUtil
.
IMPORTANCE_LOW
);
return
new
PlayerNotificationManager
(
context
,
channelId
,
notificationId
,
mediaDescriptionAdapter
);
}
/** @deprecated Use the {@link Builder} instead. */
@Deprecated
public
static
PlayerNotificationManager
createWithNotificationChannel
(
Context
context
,
String
channelId
,
@StringRes
int
channelName
,
int
notificationId
,
MediaDescriptionAdapter
mediaDescriptionAdapter
,
@Nullable
NotificationListener
notificationListener
)
{
return
createWithNotificationChannel
(
context
,
channelId
,
channelName
,
/* channelDescription= */
0
,
notificationId
,
mediaDescriptionAdapter
,
notificationListener
);
}
/** @deprecated Use the {@link Builder} instead. */
@Deprecated
public
static
PlayerNotificationManager
createWithNotificationChannel
(
Context
context
,
String
channelId
,
@StringRes
int
channelName
,
@StringRes
int
channelDescription
,
int
notificationId
,
MediaDescriptionAdapter
mediaDescriptionAdapter
,
@Nullable
NotificationListener
notificationListener
)
{
NotificationUtil
.
createNotificationChannel
(
context
,
channelId
,
channelName
,
channelDescription
,
NotificationUtil
.
IMPORTANCE_LOW
);
return
new
PlayerNotificationManager
(
context
,
channelId
,
notificationId
,
mediaDescriptionAdapter
,
notificationListener
);
}
/** @deprecated Use the {@link Builder} instead. */
@Deprecated
public
PlayerNotificationManager
(
Context
context
,
String
channelId
,
int
notificationId
,
MediaDescriptionAdapter
mediaDescriptionAdapter
)
{
this
(
context
,
channelId
,
notificationId
,
mediaDescriptionAdapter
,
/* notificationListener= */
null
,
/* customActionReceiver */
null
);
}
/** @deprecated Use the {@link Builder} instead. */
@Deprecated
public
PlayerNotificationManager
(
Context
context
,
String
channelId
,
int
notificationId
,
MediaDescriptionAdapter
mediaDescriptionAdapter
,
@Nullable
NotificationListener
notificationListener
)
{
this
(
context
,
channelId
,
notificationId
,
mediaDescriptionAdapter
,
notificationListener
,
/* customActionReceiver= */
null
);
}
/** @deprecated Use the {@link Builder} instead. */
@SuppressWarnings
(
"deprecation"
)
@Deprecated
public
PlayerNotificationManager
(
Context
context
,
String
channelId
,
int
notificationId
,
MediaDescriptionAdapter
mediaDescriptionAdapter
,
@Nullable
CustomActionReceiver
customActionReceiver
)
{
this
(
context
,
channelId
,
notificationId
,
mediaDescriptionAdapter
,
/* notificationListener= */
null
,
customActionReceiver
);
}
/** @deprecated Use the {@link Builder} instead. */
@Deprecated
public
PlayerNotificationManager
(
Context
context
,
String
channelId
,
int
notificationId
,
MediaDescriptionAdapter
mediaDescriptionAdapter
,
@Nullable
NotificationListener
notificationListener
,
@Nullable
CustomActionReceiver
customActionReceiver
)
{
this
(
context
,
channelId
,
notificationId
,
mediaDescriptionAdapter
,
notificationListener
,
customActionReceiver
,
R
.
drawable
.
exo_notification_small_icon
,
R
.
drawable
.
exo_notification_play
,
R
.
drawable
.
exo_notification_pause
,
R
.
drawable
.
exo_notification_stop
,
R
.
drawable
.
exo_notification_rewind
,
R
.
drawable
.
exo_notification_fastforward
,
R
.
drawable
.
exo_notification_previous
,
R
.
drawable
.
exo_notification_next
,
null
);
}
private
PlayerNotificationManager
(
private
PlayerNotificationManager
(
Context
context
,
Context
context
,
String
channelId
,
String
channelId
,
...
@@ -927,32 +780,6 @@ public class PlayerNotificationManager {
...
@@ -927,32 +780,6 @@ public class PlayerNotificationManager {
}
}
/**
/**
* @deprecated Use {@link #setControlDispatcher(ControlDispatcher)} with {@link
* DefaultControlDispatcher#DefaultControlDispatcher(long, long)}.
*/
@SuppressWarnings
(
"deprecation"
)
@Deprecated
public
final
void
setFastForwardIncrementMs
(
long
fastForwardMs
)
{
if
(
controlDispatcher
instanceof
DefaultControlDispatcher
)
{
((
DefaultControlDispatcher
)
controlDispatcher
).
setFastForwardIncrementMs
(
fastForwardMs
);
invalidate
();
}
}
/**
* @deprecated Use {@link #setControlDispatcher(ControlDispatcher)} with {@link
* DefaultControlDispatcher#DefaultControlDispatcher(long, long)}.
*/
@SuppressWarnings
(
"deprecation"
)
@Deprecated
public
final
void
setRewindIncrementMs
(
long
rewindMs
)
{
if
(
controlDispatcher
instanceof
DefaultControlDispatcher
)
{
((
DefaultControlDispatcher
)
controlDispatcher
).
setRewindIncrementMs
(
rewindMs
);
invalidate
();
}
}
/**
* Sets whether the next action should be used.
* Sets whether the next action should be used.
*
*
* @param useNextAction Whether to use the next action.
* @param useNextAction Whether to use the next action.
...
@@ -977,18 +804,6 @@ public class PlayerNotificationManager {
...
@@ -977,18 +804,6 @@ public class PlayerNotificationManager {
}
}
/**
/**
* Sets whether the navigation actions should be used.
*
* @param useNavigationActions Whether to use navigation actions.
* @deprecated Use {@link #setUseNextAction(boolean)} and {@link #setUsePreviousAction(boolean)}.
*/
@Deprecated
public
final
void
setUseNavigationActions
(
boolean
useNavigationActions
)
{
setUseNextAction
(
useNavigationActions
);
setUsePreviousAction
(
useNavigationActions
);
}
/**
* If {@link #setUseNextAction useNextAction} is {@code true}, sets whether the next action should
* If {@link #setUseNextAction useNextAction} is {@code true}, sets whether the next action should
* also be used in compact view. Has no effect if {@link #setUseNextAction useNextAction} is
* also be used in compact view. Has no effect if {@link #setUseNextAction useNextAction} is
* {@code false}.
* {@code false}.
...
@@ -1017,22 +832,6 @@ public class PlayerNotificationManager {
...
@@ -1017,22 +832,6 @@ public class PlayerNotificationManager {
}
}
/**
/**
* If {@link #setUseNavigationActions useNavigationActions} is {@code true}, sets whether
* navigation actions should also be used in compact view. Has no effect if {@link
* #setUseNavigationActions useNavigationActions} is {@code false}.
*
* @param useNavigationActionsInCompactView Whether to use navigation actions in compact view.
* @deprecated Use {@link #setUseNextActionInCompactView(boolean)} and {@link
* #setUsePreviousActionInCompactView(boolean)} instead.
*/
@Deprecated
public
final
void
setUseNavigationActionsInCompactView
(
boolean
useNavigationActionsInCompactView
)
{
setUseNextActionInCompactView
(
useNavigationActionsInCompactView
);
setUsePreviousActionInCompactView
(
useNavigationActionsInCompactView
);
}
/**
* Sets whether the play and pause actions should be used.
* Sets whether the play and pause actions should be used.
*
*
* @param usePlayPauseActions Whether to use play and pause actions.
* @param usePlayPauseActions Whether to use play and pause actions.
...
@@ -1141,8 +940,8 @@ public class PlayerNotificationManager {
...
@@ -1141,8 +940,8 @@ public class PlayerNotificationManager {
* <p>See {@link NotificationCompat.Builder#setPriority(int)}.
* <p>See {@link NotificationCompat.Builder#setPriority(int)}.
*
*
* <p>To set the priority for API levels above 25, you can create your own {@link
* <p>To set the priority for API levels above 25, you can create your own {@link
* NotificationChannel} with a given importance level and pass the id of the channel to
the
{@link
* NotificationChannel} with a given importance level and pass the id of the channel to {@link
*
#PlayerNotificationManager(Context, String, int, MediaDescriptionAdapter) constructor
}.
*
Builder#Builder(Context, int, String, MediaDescriptionAdapter)
}.
*
*
* @param priority The priority which can be one of {@link NotificationCompat#PRIORITY_DEFAULT},
* @param priority The priority which can be one of {@link NotificationCompat#PRIORITY_DEFAULT},
* {@link NotificationCompat#PRIORITY_MAX}, {@link NotificationCompat#PRIORITY_HIGH}, {@link
* {@link NotificationCompat#PRIORITY_MAX}, {@link NotificationCompat#PRIORITY_HIGH}, {@link
...
...
library/ui/src/main/java/com/google/android/exoplayer2/ui/PlayerView.java
View file @
a264a0a0
...
@@ -47,7 +47,6 @@ import androidx.annotation.RequiresApi;
...
@@ -47,7 +47,6 @@ import androidx.annotation.RequiresApi;
import
androidx.core.content.ContextCompat
;
import
androidx.core.content.ContextCompat
;
import
com.google.android.exoplayer2.C
;
import
com.google.android.exoplayer2.C
;
import
com.google.android.exoplayer2.ControlDispatcher
;
import
com.google.android.exoplayer2.ControlDispatcher
;
import
com.google.android.exoplayer2.DefaultControlDispatcher
;
import
com.google.android.exoplayer2.ExoPlaybackException
;
import
com.google.android.exoplayer2.ExoPlaybackException
;
import
com.google.android.exoplayer2.Player
;
import
com.google.android.exoplayer2.Player
;
import
com.google.android.exoplayer2.Player.DiscontinuityReason
;
import
com.google.android.exoplayer2.Player.DiscontinuityReason
;
...
@@ -976,28 +975,6 @@ public class PlayerView extends FrameLayout implements AdViewProvider {
...
@@ -976,28 +975,6 @@ public class PlayerView extends FrameLayout implements AdViewProvider {
}
}
/**
/**
* @deprecated Use {@link #setControlDispatcher(ControlDispatcher)} with {@link
* DefaultControlDispatcher#DefaultControlDispatcher(long, long)}.
*/
@SuppressWarnings
(
"deprecation"
)
@Deprecated
public
void
setRewindIncrementMs
(
int
rewindMs
)
{
Assertions
.
checkStateNotNull
(
controller
);
controller
.
setRewindIncrementMs
(
rewindMs
);
}
/**
* @deprecated Use {@link #setControlDispatcher(ControlDispatcher)} with {@link
* DefaultControlDispatcher#DefaultControlDispatcher(long, long)}.
*/
@SuppressWarnings
(
"deprecation"
)
@Deprecated
public
void
setFastForwardIncrementMs
(
int
fastForwardMs
)
{
Assertions
.
checkStateNotNull
(
controller
);
controller
.
setFastForwardIncrementMs
(
fastForwardMs
);
}
/**
* Sets which repeat toggle modes are enabled.
* Sets which repeat toggle modes are enabled.
*
*
* @param repeatToggleModes A set of {@link RepeatModeUtil.RepeatToggleModes}.
* @param repeatToggleModes A set of {@link RepeatModeUtil.RepeatToggleModes}.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment