Android (ExoPlayer)
Example of video playback on Android using ExoPlayer
implementation 'com.google.android.exoplayer:exoplayer-hls:2.X.X'
SimpleExoPlayer player = new SimpleExoPlayer.Builder(context).build();
// Set the media item to the Cloudflare Stream HLS Manifest URL:player.setMediaItem(MediaItem.fromUri("https://customer-9cbb9x7nxdw5hb57.cloudflarestream.com/8f92fe7d2c1c0983767649e065e691fc/manifest/video.m3u8"));
player.prepare();
- Download this example app ↗ from the official Android developer docs, following this guide ↗.
- Open and run the exoplayer-codelab-04 example app ↗ using Android Studio ↗.
- Replace the
media_url_dash
URL on this line ↗ with the DASH manifest URL for your video.
For more, see read the docs.
Was this helpful?
- Resources
- API
- New to Cloudflare?
- Products
- Sponsorships
- Open Source
- Support
- Help Center
- System Status
- Compliance
- GDPR
- Company
- cloudflare.com
- Our team
- Careers
- 2025 Cloudflare, Inc.
- Privacy Policy
- Terms of Use
- Report Security Issues
- Trademark