diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 16b42dcf9f..35b2d41a65 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -2,6 +2,10 @@ ### dev-v2 (not yet released) ### +* Add `ExoCastPlayer` to cast to custom receiver apps using ExoPlayer's custom + communication protocol + ([#5486](https://github.com/google/ExoPlayer/issues/5486)). Also update the + Cast demo app to work with `ExoCastPlayer`. * HLS: * Form an adaptive track group out of audio renditions with matching name. * `ExtractorMediaSource` renamed to `ProgressiveMediaSource`. diff --git a/demos/cast/build.gradle b/demos/cast/build.gradle index e056530d45..c898557cab 100644 --- a/demos/cast/build.gradle +++ b/demos/cast/build.gradle @@ -52,6 +52,11 @@ android { flavorDimensions "receiver" productFlavors { + exoCast { + dimension "receiver" + manifestPlaceholders = + [castOptionsProvider: "com.google.android.exoplayer2.ext.cast.ExoCastOptionsProvider"] + } defaultCast { dimension "receiver" manifestPlaceholders = diff --git a/demos/cast/src/main/java/com/google/android/exoplayer2/castdemo/MainActivity.java b/demos/cast/src/main/java/com/google/android/exoplayer2/castdemo/MainActivity.java index 48934abd2c..7b525b04be 100644 --- a/demos/cast/src/main/java/com/google/android/exoplayer2/castdemo/MainActivity.java +++ b/demos/cast/src/main/java/com/google/android/exoplayer2/castdemo/MainActivity.java @@ -128,6 +128,15 @@ public class MainActivity extends AppCompatActivity /* context= */ this, castContext); break; + case ExoCastOptionsProvider.RECEIVER_ID: + playerManager = + new ExoCastPlayerManager( + /* queueChangesListener= */ this, + localPlayerView, + castControlView, + /* context= */ this, + castContext); + break; default: throw new IllegalStateException("Illegal receiver app id: " + applicationId); }