
Master media playback features using Exoplayer while maintaining a clean, straightforward app interface. Build a solid foundation in general media technologies to effectively use Exoplayer and avoid overemphasizing architecture.
Explore the Android media playback workflow with Media3 ExoPlayer and Jetpack Compose, covering ExoPlayer core, ExoPlayer UI, media session, transformer, ad insertion, and DRM integration.
Download and explore the Media3 source code to run core demo apps, test streams, and learn how to implement dash, hls, smooth streaming, and ad insertion.
Build a simple Android app that plays video with Media3 ExoPlayer in Compose, centering a 16 by nine video surface and wiring surface lifecycle for playback.
Add and configure media playback dependencies for Media3 Exoplayer, including core Exoplayer, Exoplayer dash if needed, and optional Media3 UI, using version 1.5.1 and a version catalog.
Compare surface view and texture view for drm content playback using ExoPlayer, exploring drm l1 widevine requirements, secure stream urls, and test workflows across labs modules.
Texture view supports transparency from early Android versions, while surface view requires Android 14, and external surface composables cannot apply alpha.
Compare surface view and texture view for video rotation, showing texture view supports a 90-degree rotation with rotation animation, while surface view fails due to separate local and external surfaces.
Compare surface view and texture view for video scale and offset, showing texture view copies pixels while surface view relays scale, offset, and alpha to the external surface on Android.
Exoplayer supports progressive and adaptive media sources, infers types from stream URLs and manifest files, and dynamically switches dash, Apple HLS, and Microsoft Smooth Streaming tracks under changing network conditions.
Learn how video encoding compresses streams for storage and streaming, from raw frames to H264, Hevc, VP8, and VP9, and how ExoPlayer extracts and relies on hardware decoding.
Learn how a video encoder compresses video by exploiting temporal and spatial redundancy, using i-frames, p-frames, and b-frames with reference frames.
Trace the Exoplayer media playback workflow from backend encoding and packaging to dash manifest delivery via CDNs, through prepare, decode, and display on device hardware.
Create a playback view model to persist the exoplayer instance across rotations, manage media items and surface bindings, and start playback in onStart for efficient memory use.
Identify and fix a memory leak in ExoPlayer by stopping and releasing playback in the ViewModel and the activity lifecycle, reducing Java heap usage and releasing hardware decoders.
Explore Exoplayer state transitions from idle to buffering to ready and ended, including the final released state, and how prepare, play, pause, and stop manage decoding and buffering.
Use ExoPlayer's on video size callback to obtain the real video size, compute the correct aspect ratio, and update the UI model to apply it.
Implement centered playback state controls for ExoPlayer in a Compose UI, including fast forward, rewind, start over, and play/pause, with loading indicators, restart on end, and error/retry behavior.
Add a placeholder image below the player controls to show during idle playback, preventing a black screen for DRM content, with a view model that toggles visibility by playback state.
Map ExoPlayer tracks to UI models by handling the on tracks changed callback, creating ExoPlayerTrack mappings for video, audio, and subtitle tracks.
Implement a track selection UI for Android media playback with Media3 ExoPlayer and Compose, adding a settings button and a modal bottom sheet to switch video, audio, and subtitle tracks.
Add a subtitles composable that wraps the Exoplayer subtitle view in an Android view, renders cues in the video overlay, and updates the player UI model with current subtitles.
Test playback on an old fire tv stick, observe an out of memory crash, and enable a large heap flag to increase Java heap for ExoPlayer on legacy Android versions.
Compare memory usage between exoplayer and a shaka webview player by playing tears of steel in a webview, showing app memory over 250mb while java heap stays around 14mb.
Compare client side ad insertion and server side ad insertion for video streams, focusing on Exoplayer Ima SDK for client side implementation.
Learn how edit tag provides metadata via a URL, how vmap and vast coordinate ad scheduling with pre-roll and mid-roll ads, how ad beacons report start, end, or mute events.
Add ad ui models and overlay elements that sync with ad states, including time bar markers for ad groups and an ad counter during playback.
Listen for ad events with the IMA SDK in ExoPlayer, fetch ad group data from EMR SDK, build ad groups from timeline, and update the UI model with ad progress.
Explore how drm, which encrypts media content, protects after access, explaining why drm matters for Android ExoPlayer and how a license url configures playback to guard against recording and sharing.
Understand DRM schemes and licenses, including how encryption, license issuance, and access restrictions operate on devices; learn about Widevine L1, Fairplay, and how license servers interact with secure hardware.
In this course, you'll learn how to build a fully functional media playback app using Android’s modern Media3 ExoPlayer library. We’ll focus on integrating media playback seamlessly while leveraging Jetpack Compose for a modern and interactive UI.
This course is designed for Android developers who want to implement media playback in their apps. While prior experience with media playback isn’t required, you should have a decent understanding of Android development and be familiar with Jetpack Compose. The primary goal is to explore ExoPlayer and its capabilities rather than focusing on clean architecture.
What You Will Learn
Media3 Library Overview
Understand the core components of Media3, including exoPlayer, exoPlayer-ui, mediaSession, and transformer. This course primarily focuses on ExoPlayer for handling audio and video playback.
TextureView vs. SurfaceView
Learn the differences between TextureView and SurfaceView, the two primary video sinks used for rendering video content.
Interactive UI with Jetpack Compose
Build an interactive playback interface using Jetpack Compose with features like video seeking, track selection, and time bar rendering while optimizing memory usage.
Media Codecs & Media Sources
Explore adaptive streaming, media codecs, and container formats, and examine how different components in ExoPlayer interact during media playback.
Video Ads with ExoPlayer IMA
Learn how to insert video ads using the Interactive Media Ads (IMA) SDK with ExoPlayer. Get an introduction to VAST (Video Ad Serving Template) and VMAP (Video Multiple Ad Playlist).
Digital Rights Management (DRM)
Get a deep understanding or how DRM works in Android and how to configure ExoPlayer to play a DRM protected content.
By the end of this course, you’ll have a deep understanding of ExoPlayer and be able to integrate high-performance media playback into your Android apps.