Android (ExoPlayer)
ExoPlayerを使用したAndroidでのビデオ再生の例
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();- このサンプルアプリ ↗を公式のAndroid開発者ドキュメントからダウンロードし、このガイド ↗に従ってください。
- Android Studio ↗を使用して、exoplayer-codelab-04サンプルアプリ ↗を開いて実行します。
- この行 ↗の
media_url_dashURLを、あなたのビデオのDASHマニフェストURLに置き換えます。
詳細については、ドキュメントを読むを参照してください。