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
This commit is contained in:
ibaker 2022-05-23 09:05:02 +01:00 committed by Ian Baker
parent bbb6d8f049
commit 5baeffbf59
2 changed files with 3 additions and 3 deletions

View file

@ -220,7 +220,7 @@ server-side ad insertion `MediaSource` for URIs using the `ssai://` scheme:
Player player =
new ExoPlayer.Builder(context)
.setMediaSourceFactory(
new DefaultMediaSourceFactory(dataSourceFactory)
new DefaultMediaSourceFactory(context)
.setServerSideAdInsertionMediaSourceFactory(ssaiFactory))
.build();
```
@ -241,7 +241,7 @@ In order to use this class, you need to set up the
```
// MediaSource.Factory to load the actual media stream.
DefaultMediaSourceFactory defaultMediaSourceFactory =
new DefaultMediaSourceFactory(dataSourceFactory);
new DefaultMediaSourceFactory(context);
// AdsLoader that can be reused for multiple playbacks.
ImaServerSideAdInsertionMediaSource.AdsLoader adsLoader =
new ImaServerSideAdInsertionMediaSource.AdsLoader.Builder(context, adViewProvider)

View file

@ -94,7 +94,7 @@ DrmSessionManager customDrmSessionManager =
new CustomDrmSessionManager(/* ... */);
// Pass a drm session manager provider to the media source factory.
MediaSource.Factory mediaSourceFactory =
new DefaultMediaSourceFactory(dataSourceFactory)
new DefaultMediaSourceFactory(context)
.setDrmSessionManagerProvider(mediaItem -> customDrmSessionManager);
~~~
{: .language-java}