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. 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)
  2. Media3 • tools for transcoding and video editing with media3-transformer

    • easy to migrate from ExoPlayer • Jetpack will be the home for ExoPlayer future releases
  3. 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"
  4. 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()
  5. 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()
  6. 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()
  7. 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()
  8. 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)
  9. 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"