Skip to content

非公式 / UnofficialCloudflare, Inc. 非提携。アカウント情報は入力しないでください。Not affiliated with Cloudflare, Inc. Do not enter Cloudflare credentials here.Official docsこのサイトについてプライバシー

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

役に立ちましたか?