Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Whats new in Android Media?

Whats new in Android Media?

Slides for Google I/O Extended Yangon event.

Reference links

What's new in Android media
https://www.youtube.com/watch?v=Ba70zmFZgk0

How to optimize media streaming with ExoPlayer
https://www.youtube.com/watch?v=Hw0Jeq42FNU&t=466s

What's next for AndroidX Media and ExoPlayer
https://www.youtube.com/watch?v=sTIBDcyCmCg

Introducing Jetpack Media3
https://android-developers.googleblog.com/2021/10/jetpack-media3.html

Universal Android Music Player Sample
https://github.com/android/uamp

More Decks by မျိုးလွင်ဦး

Other Decks in Technology

Transcript

  1. Myo Lwin Oo What’s new in Android Media? Google I/O

    Extended - Yangon
  2. I/O updates • New platform capabilities in Android13 • Media

    library updates
  3. New platform capabilities in Android13 • HDR Video
 - Already

    available for fl agship devices, but hard for developer to implement
 - New APIs for Capture/Encode, Playback, Edit, Share
 - Convert HDR to SDR with transformer library
 - Requires SurfaceView
 - Will be available in Media3 Jetpack • Spatial Audio
 - Developer APIs will be available soon (Spatializer Class in AudioManager)
 - ExoPlayer 2.17 supports spatial audio out of the box! (Android12L and above) • Others (MIDI 2.0)
  4. Existing Media APIs • Jetpack Media • Jetpack Media2 •

    ExoPlayer
  5. Libraries media2-player media2-widget media2-session media2-common androidx.media2 exoplayer-core exoplayer-ui exoplayer- mediasession

    exoplayer- common com.google.android.exoplayer exoplayer-dash exoplayer-dash
  6. Which library to use?

  7. Media3 media3-exoplayer media3-ui media3-session media3-common androidx.media3 exoplayer-dash media3- exoplayer-dash

  8. Media3 • tools for transcoding and video editing with media3-transformer

    • easy to migrate from ExoPlayer • Jetpack will be the home for ExoPlayer future releases
  9. Media3 Adding dependency def media3_version = "1.0.0-alpha03" implementation "androidx.media3:media3-exoplayer:$media3_version" implementation

    "androidx.media3:media3-ui:$media3_version" implementation "androidx.media3:media3-exoplayer-dash:$media3_version"
  10. Media3 Setup playback val player = ExoPlayer.Builder(requireContext()).build() binding.playerView.player = player

    val mediaItem = MediaItem.fromUri("url_here") player.setMediaItem(mediaItem) player.playWhenReady = true player.prepare()
  11. Media3 Setup playback val player = ExoPlayer.Builder(requireContext()).build() binding.playerView.player = player

    val mediaItem = MediaItem.fromUri("url_here") player.setMediaItem(mediaItem) player.playWhenReady = true player.prepare()
  12. Media3 Setup playback val player = ExoPlayer.Builder(requireContext()).build() binding.playerView.player = player

    val mediaItem = MediaItem.fromUri("url_here") player.setMediaItem(mediaItem) player.playWhenReady = true player.prepare()
  13. Media3 Setup playback val player = ExoPlayer.Builder(requireContext()).build() binding.playerView.player = player

    val mediaItem = MediaItem.fromUri("url_here") player.setMediaItem(mediaItem) player.playWhenReady = true player.prepare()
  14. Media Session • a universal way of interacting with a

    video/audio player • playback control can be delegated to external sources
 (buttons from remote controls, voice commands from Google Assistant)
  15. Media Session Setup val session = MediaSession.Builder(requireContext(), player).build() // session

    is ready to use now, eg. session.connectedControllers def media3_version = "1.0.0-alpha03" implementation "androidx.media3:media3-session:$media3_version"
  16. Question Time

  17. Thank you.