Remove references to deprecated DefaultDataSourceFactory from dev guide
#minor-release PiperOrigin-RevId: 436997521
This commit is contained in:
parent
2d025a2797
commit
5b08df001a
@ -59,7 +59,7 @@ DataSource.Factory httpDataSourceFactory =
|
|||||||
DefaultDataSource.Factory dataSourceFactory =
|
DefaultDataSource.Factory dataSourceFactory =
|
||||||
new DefaultDataSource.Factory(context, httpDataSourceFactory);
|
new DefaultDataSource.Factory(context, httpDataSourceFactory);
|
||||||
|
|
||||||
// Inject the DefaultDataSourceFactory when creating the player.
|
// Inject the DefaultDataSource.Factory when creating the player.
|
||||||
ExoPlayer player =
|
ExoPlayer player =
|
||||||
new ExoPlayer.Builder(context)
|
new ExoPlayer.Builder(context)
|
||||||
.setMediaSourceFactory(new DefaultMediaSourceFactory(dataSourceFactory))
|
.setMediaSourceFactory(new DefaultMediaSourceFactory(dataSourceFactory))
|
||||||
|
@ -22,14 +22,14 @@ that corresponds to the network stack you wish to use. If your application also
|
|||||||
needs to play non-http(s) content such as local files, use
|
needs to play non-http(s) content such as local files, use
|
||||||
|
|
||||||
~~~
|
~~~
|
||||||
new DefaultDataSourceFactory(
|
new DefaultDataSource.Factory(
|
||||||
...
|
...
|
||||||
/* baseDataSourceFactory= */ new PreferredHttpDataSource.Factory(...));
|
/* baseDataSourceFactory= */ new PreferredHttpDataSource.Factory(...));
|
||||||
~~~
|
~~~
|
||||||
{: .language-java}
|
{: .language-java}
|
||||||
|
|
||||||
where `PreferredHttpDataSource.Factory` is the factory corresponding to your
|
where `PreferredHttpDataSource.Factory` is the factory corresponding to your
|
||||||
preferred network stack. The `DefaultDataSourceFactory` layer adds in support
|
preferred network stack. The `DefaultDataSource.Factory` layer adds in support
|
||||||
for non-http(s) sources such as local files.
|
for non-http(s) sources such as local files.
|
||||||
|
|
||||||
The example below shows how to build an `ExoPlayer` that will use the Cronet
|
The example below shows how to build an `ExoPlayer` that will use the Cronet
|
||||||
@ -48,7 +48,7 @@ DefaultDataSource.Factory dataSourceFactory =
|
|||||||
context,
|
context,
|
||||||
/* baseDataSourceFactory= */ cronetDataSourceFactory);
|
/* baseDataSourceFactory= */ cronetDataSourceFactory);
|
||||||
|
|
||||||
// Inject the DefaultDataSourceFactory when creating the player.
|
// Inject the DefaultDataSource.Factory when creating the player.
|
||||||
ExoPlayer player =
|
ExoPlayer player =
|
||||||
new ExoPlayer.Builder(context)
|
new ExoPlayer.Builder(context)
|
||||||
.setMediaSourceFactory(new DefaultMediaSourceFactory(dataSourceFactory))
|
.setMediaSourceFactory(new DefaultMediaSourceFactory(dataSourceFactory))
|
||||||
|
@ -38,8 +38,9 @@ If your application only needs to play http(s) content, using the Cronet
|
|||||||
extension is as simple as updating `DataSource.Factory` instantiations in your
|
extension is as simple as updating `DataSource.Factory` instantiations in your
|
||||||
application code to use `CronetDataSource.Factory`. If your application also
|
application code to use `CronetDataSource.Factory`. If your application also
|
||||||
needs to play non-http(s) content such as local files, use:
|
needs to play non-http(s) content such as local files, use:
|
||||||
|
|
||||||
```
|
```
|
||||||
new DefaultDataSourceFactory(
|
new DefaultDataSource.Factory(
|
||||||
...
|
...
|
||||||
/* baseDataSourceFactory= */ new CronetDataSource.Factory(...) );
|
/* baseDataSourceFactory= */ new CronetDataSource.Factory(...) );
|
||||||
```
|
```
|
||||||
|
@ -39,7 +39,7 @@ injected from application code.
|
|||||||
|
|
||||||
`DefaultDataSource` will automatically use the RTMP extension whenever it's
|
`DefaultDataSource` will automatically use the RTMP extension whenever it's
|
||||||
available. Hence if your application is using `DefaultDataSource` or
|
available. Hence if your application is using `DefaultDataSource` or
|
||||||
`DefaultDataSourceFactory`, adding support for RTMP streams is as simple as
|
`DefaultDataSource.Factory`, adding support for RTMP streams is as simple as
|
||||||
adding a dependency to the RTMP extension as described above. No changes to your
|
adding a dependency to the RTMP extension as described above. No changes to your
|
||||||
application code are required. Alternatively, if you know that your application
|
application code are required. Alternatively, if you know that your application
|
||||||
doesn't need to handle any other protocols, you can update any
|
doesn't need to handle any other protocols, you can update any
|
||||||
|
Loading…
x
Reference in New Issue
Block a user