Skip to content

Commit

Permalink
Make media2 extension depend on androidx media2 1.1.0
Browse files Browse the repository at this point in the history
Issue: #8011
#minor-release
PiperOrigin-RevId: 347288689
  • Loading branch information
sungsoo authored and icbaker committed Dec 14, 2020
1 parent 0d61b89 commit 4907cf8
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 143 deletions.
5 changes: 5 additions & 0 deletions RELEASENOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@
* Text:
* Gracefully handle null-terminated subtitle content in Matroska
containers.
* Media2 extension
* Make media2-extension depend on AndroidX media2:media2-session:1.1.0 to
fix a deadlock while creating PlaybackStateCompat internally.
([#8011](https://github.com/google/ExoPlayer/issues/8011)).

### 2.12.2 (2020-12-01) ###

Expand Down Expand Up @@ -121,6 +125,7 @@
* Notify onBufferingEnded when the state of origin player becomes
`STATE_IDLE` or `STATE_ENDED`.
* Allow to remove all playlist items that makes the player reset.
([#8047](https://github.com/google/ExoPlayer/issues/8047)).
* MediaSession extension:
* Support `setPlaybackSpeed(float)` and disable it by default. Use
`MediaSessionConnector.setEnabledPlaybackActions(long)` to enable
Expand Down
2 changes: 2 additions & 0 deletions constants.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ project.ext {
androidxAnnotationVersion = '1.1.0'
androidxAppCompatVersion = '1.1.0'
androidxCollectionVersion = '1.1.0'
androidxFuturesVersion = '1.1.0'
androidxMediaVersion = '1.2.1'
androidxMedia2Version = '1.1.0'
androidxMultidexVersion = '2.0.0'
androidxRecyclerViewVersion = '1.1.0'
androidxTestCoreVersion = '1.3.0'
Expand Down
4 changes: 2 additions & 2 deletions extensions/media2/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ android.defaultConfig.minSdkVersion 19
dependencies {
implementation project(modulePrefix + 'library-core')
implementation 'androidx.collection:collection:' + androidxCollectionVersion
implementation 'androidx.concurrent:concurrent-futures:1.1.0'
api 'androidx.media2:media2-session:1.0.3'
implementation 'androidx.concurrent:concurrent-futures:' + androidxFuturesVersion
api 'androidx.media2:media2-session:' + androidxMedia2Version
compileOnly 'org.checkerframework:checker-compat-qual:' + checkerframeworkCompatVersion
compileOnly 'org.checkerframework:checker-qual:' + checkerframeworkVersion
compileOnly 'org.jetbrains.kotlin:kotlin-annotations-jvm:' + kotlinAnnotationsVersion
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -437,9 +437,7 @@ public int getNextMediaItemIndex() {
/* defaultValueWhenException= */ END_OF_PLAYLIST);
}

// TODO(internal b/160846312): Call super.close() once we depend on media2 1.1.0.
@Override
@SuppressWarnings("MissingSuperCall")
public void close() {
synchronized (stateLock) {
if (closed) {
Expand All @@ -454,6 +452,7 @@ public void close() {
player.close();
return null;
});
super.close();
}

// SessionPlayerConnector-specific functions.
Expand Down Expand Up @@ -578,11 +577,6 @@ private void handlePlaylistChangedOnHandler() {
SessionPlayerConnector.this, currentPlaylist, playlistMetadata);
if (notifyCurrentMediaItem) {
callback.onCurrentMediaItemChanged(SessionPlayerConnector.this, currentMediaItem);

// Workaround for MediaSession's issue that current media item change isn't propagated
// to the legacy controllers.
// TODO(internal b/160846312): Remove workaround once we depend on media2 1.1.0.
callback.onSeekCompleted(SessionPlayerConnector.this, currentPosition);
}
});
}
Expand All @@ -597,11 +591,6 @@ private void notifySkipToCompletedOnHandler() {
notifySessionPlayerCallback(
callback -> {
callback.onCurrentMediaItemChanged(SessionPlayerConnector.this, currentMediaItem);

// Workaround for MediaSession's issue that current media item change isn't propagated
// to the legacy controllers.
// TODO(internal b/160846312): Remove workaround once we depend on media2 1.1.0.
callback.onSeekCompleted(SessionPlayerConnector.this, currentPosition);
});
}

Expand Down Expand Up @@ -722,11 +711,6 @@ public void onCurrentMediaItemChanged(MediaItem mediaItem) {
notifySessionPlayerCallback(
callback -> {
callback.onCurrentMediaItemChanged(SessionPlayerConnector.this, mediaItem);

// Workaround for MediaSession's issue that current media item change isn't propagated
// to the legacy controllers.
// TODO(internal b/160846312): Remove workaround once we depend on media2 1.1.0.
callback.onSeekCompleted(SessionPlayerConnector.this, currentPosition);
});
}

Expand Down

0 comments on commit 4907cf8

Please sign in to comment.