Commit 5baeffbf by ibaker Committed by Ian Baker

Simplify some DefaultMediaSourceFactory instantiation in the dev guide

In many cases we're passing a 'custom' DataSource.Factory where it's not
relevant for the respective dev guide section.

#minor-release

PiperOrigin-RevId: 450374171
parent bbb6d8f0
Showing with 3 additions and 3 deletions
...@@ -220,7 +220,7 @@ server-side ad insertion `MediaSource` for URIs using the `ssai://` scheme: ...@@ -220,7 +220,7 @@ server-side ad insertion `MediaSource` for URIs using the `ssai://` scheme:
Player player = Player player =
new ExoPlayer.Builder(context) new ExoPlayer.Builder(context)
.setMediaSourceFactory( .setMediaSourceFactory(
new DefaultMediaSourceFactory(dataSourceFactory) new DefaultMediaSourceFactory(context)
.setServerSideAdInsertionMediaSourceFactory(ssaiFactory)) .setServerSideAdInsertionMediaSourceFactory(ssaiFactory))
.build(); .build();
``` ```
...@@ -241,7 +241,7 @@ In order to use this class, you need to set up the ...@@ -241,7 +241,7 @@ In order to use this class, you need to set up the
``` ```
// MediaSource.Factory to load the actual media stream. // MediaSource.Factory to load the actual media stream.
DefaultMediaSourceFactory defaultMediaSourceFactory = DefaultMediaSourceFactory defaultMediaSourceFactory =
new DefaultMediaSourceFactory(dataSourceFactory); new DefaultMediaSourceFactory(context);
// AdsLoader that can be reused for multiple playbacks. // AdsLoader that can be reused for multiple playbacks.
ImaServerSideAdInsertionMediaSource.AdsLoader adsLoader = ImaServerSideAdInsertionMediaSource.AdsLoader adsLoader =
new ImaServerSideAdInsertionMediaSource.AdsLoader.Builder(context, adViewProvider) new ImaServerSideAdInsertionMediaSource.AdsLoader.Builder(context, adViewProvider)
......
...@@ -94,7 +94,7 @@ DrmSessionManager customDrmSessionManager = ...@@ -94,7 +94,7 @@ DrmSessionManager customDrmSessionManager =
new CustomDrmSessionManager(/* ... */); new CustomDrmSessionManager(/* ... */);
// Pass a drm session manager provider to the media source factory. // Pass a drm session manager provider to the media source factory.
MediaSource.Factory mediaSourceFactory = MediaSource.Factory mediaSourceFactory =
new DefaultMediaSourceFactory(dataSourceFactory) new DefaultMediaSourceFactory(context)
.setDrmSessionManagerProvider(mediaItem -> customDrmSessionManager); .setDrmSessionManagerProvider(mediaItem -> customDrmSessionManager);
~~~ ~~~
{: .language-java} {: .language-java}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment