Skip to content

非公式本サイトは非公式の日本語ドキュメントであり、Cloudflare 公式サイトではありません。最新情報はdevelopers.cloudflare.comをご確認ください。

Android

最終更新 Markdown で表示Agent セットアップ

ExoPlayer を使うと、ネイティブ Android アプリでオンデマンド動画とライブ配信の両方を再生できます。

サンプルアプリ

ExoPlayer を使う

ExoPlayer で Cloudflare Stream の動画を再生します。

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();

役に立ちましたか?