Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
SDK
/
exoplayer
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
57a937d7
authored
Mar 31, 2022
by
ibaker
Committed by
Ian Baker
Apr 07, 2022
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Deduplicate the network-stacks and customization dev guide pages
PiperOrigin-RevId: 438547078
parent
36376eb9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
29 deletions
docs/customization.md
docs/customization.md
View file @
57a937d7
...
@@ -43,33 +43,7 @@ described below.
...
@@ -43,33 +43,7 @@ described below.
### Configuring the network stack ###
### Configuring the network stack ###
ExoPlayer supports Android's default network stack, as well as Cronet and
We have a page about
[
customizing the network stack used by ExoPlayer
]
.
OkHttp. In each case it's possible to customize the network stack for your use
case. The following example shows how to customize the player to use Android's
default network stack with cross-protocol redirects enabled:
~~~
// Build a DefaultHttpDataSource.Factory with cross-protocol redirects enabled.
DataSource.Factory httpDataSourceFactory =
new DefaultHttpDataSource.Factory().setAllowCrossProtocolRedirects(true);
// Wrap the DefaultHttpDataSource.Factory in a DefaultDataSource.Factory, which
// adds in support for requesting data from other sources (e.g., files,
// resources, etc).
DefaultDataSource.Factory dataSourceFactory =
new DefaultDataSource.Factory(context, httpDataSourceFactory);
// Inject the DefaultDataSource.Factory when creating the player.
ExoPlayer player =
new ExoPlayer.Builder(context)
.setMediaSourceFactory(new DefaultMediaSourceFactory(dataSourceFactory))
.build();
~~~
{: .language-java}
The same approach can be used to configure and inject HTTP-based
`DataSource.Factory`
implementations provided by the
[
Cronet extension
]
and the
[
OkHttp extension
]
, depending on your preferred choice of network stack.
### Caching data loaded from the network ###
### Caching data loaded from the network ###
...
@@ -299,8 +273,7 @@ When building custom components, we recommend the following:
...
@@ -299,8 +273,7 @@ When building custom components, we recommend the following:
ensures that they are executed in order with any other operations being
ensures that they are executed in order with any other operations being
performed on the player.
performed on the player.
[
Cronet extension
]:
https://github.com/google/ExoPlayer/tree/release-v2/extensions/cronet
[
customizing the network stack used by ExoPlayer
]:
{{
site.baseurl }}/network-stacks.html
[
OkHttp extension
]:
https://github.com/google/ExoPlayer/tree/release-v2/extensions/okhttp
[
LoadErrorHandlingPolicy
]:
{{
site.exo_sdk }}/upstream/LoadErrorHandlingPolicy.html
[
LoadErrorHandlingPolicy
]:
{{
site.exo_sdk }}/upstream/LoadErrorHandlingPolicy.html
[
media source based playlist API
]:
{{
site.baseurl }}/media-sources.html#media-source-based-playlist-api
[
media source based playlist API
]:
{{
site.baseurl }}/media-sources.html#media-source-based-playlist-api
[
asynchronous mode
]:
https://developer.android.com/reference/android/media/MediaCodec#asynchronous-processing-using-buffers
[
asynchronous mode
]:
https://developer.android.com/reference/android/media/MediaCodec#asynchronous-processing-using-buffers
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment