Media2-Widget Version 1.0.0-beta01

July 2, 2019

androidx.media2:media2-widget:1.0.0-beta01 is released. The commits included in this version can be found here.

New features

  • Background playback: Instead of creating player inside of VideoView, VideoView can take SessionPlayer or MediaController so that the app can move to background playback mode seamlessly.
  • Removed the dependency with media2-player library
  • Added onViewTypeChangedListener

API changes

  • Visibility change from public to protected:
    • VideoView.onMeasure(int, int)
    • VideoView.onAttachedToWindow()
    • VideoView.onDetachedFromWindow()
    • MediaControlView.onMeasure(int, int)
  • Removed:
    • VideoView.getSessionToken()
    • VideoView.setAudioAttributes(AudioAttributesCompat)
    • VideoView.setMedaItem(MediaItem)
    • MediaControlView.setSessionToken(SessionToken)
  • Added:
    • VideoView.setMediaController(MediaController)
    • VideoView.getMediaControlView()
    • VideoView.setMediaController(MediaController)
    • VideoView.setPlayer(SessionPlayer)
    • VideoView.setOnViewTypeChangedListener()
    • MediaControlView.setPlayer(SessionPlayer)
    • MediaControlView.setMediaController(MediaContoller)

Version 1.0.0-rc01

June 18, 2019

androidx.media2:media2-common:1.0.0-rc01, androidx.media2:media2-player:1.0.0-rc01, and androidx.media2:media2-session:1.0.0-rc01 is released. The commits included in this version can be found here.

API changes

  • Dependencies on ListenableFuture have been migrated back to Guava’s standalone implementation.

  • Note that if you have test targets that depend on the full Guava artifact, you may encounter a dependency resolution conflict when using certain versions of Android Gradle Plugin. If you encounter a Could not resolve all artifacts error involving ListenableFuture, you may temporarily work around the issue by adding android.dependency.useConstraints=false to your project’s build configuration. We are currently working on a permanent fix within Android Gradle Plugin to be released at a later date.

Version 1.0.0-beta02

June 5, 2019

androidx.media2:media2-common:1.0.0-beta02, androidx.media2:media2-player:1.0.0-beta02, and androidx.media2:media2-session:1.0.0-beta02 are released. The commits included in this version can be found here.

Bug fixes

  • Setting negative playback speed on will return RESULT_ERROR_BAD_VALUE.
  • Replace Guava ListenableFuture with Jetpack implementation (aosp/968828)

Version 1.0.0-beta01

May 7, 2019

androidx.media2:media2-common:1.0.0-beta01, androidx.media2:media2-player:1.0.0-beta01 , and androidx.media2:media2-session:1.0.0-beta01 are released. The commits included in this version can be found here.

New features

  • Libraries are separated into 3 pieces: media2-common, media2-player, media2-session
  • Changed IllegalPointerException to NullPointerException for the null arguments which marked as @NonNull.

API changes

  • Introduced MediaController.Builder
  • Added setter methods for the optional fields of FileMediaItem.Builder
  • MediaController and MediaBrowser can send application’s connection hints to MediaSession, MediaSessionService or MediaLibraryService
  • Some methods are renamed to follow Android Q Media2 APIs

Version 1.0.0-alpha04

December 17, 2018

API changes

  • Renamed the following classes:
    • MediaPlayer2MediaPlayer
    • MediaSession2MediaSession
    • MediaController2MediaController
    • MediaSessionService2MediaSessionService
    • MediaLibraryService2MediaLibraryService
    • MediaBrowser2MediaBrowser
    • MediaMetadata2MediaMetadata
    • Rating2Rating
    • SessionToken2SessionToken
    • SessionCommand2SessionCommand
    • SessionCommandGroup2SessionCommandGroup
  • Merged the following classes:
    • DataSourceDesc2 and MediaItem2 have been combined into MediaItem
    • MediaPlaylistAgent and MediaPlayerConnector have been combined into SessionPlayer
  • Added the following subclasses of Rating: HeartRating, PercentageRating, StarRating, and ThumbRating
  • Media2 now uses ListenableFuture for async methods