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
b7b49032
authored
Nov 02, 2021
by
Sebastian Roth
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
some RTSP docs
parent
0830c06c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
0 deletions
docs/rtsp.md
docs/rtsp.md
View file @
b7b49032
...
...
@@ -51,6 +51,30 @@ player.prepare();
~~~
{: .language-java}
### Passing a custom SocketFactory
By default,
`RtspMediaSource`
will use Java's standard socket factory (
`SocketFactory.getDefault()`
)
to create connections to the remote endpoints. This behavior can be overridden using
`.setSocketFactory()`
.
~~~
// Create an RTSP media source pointing to an RTSP uri and override the socket factory.
MediaSource mediaSource =
new RtspMediaSource.Factory()
.setSocketFactory(...)
.createMediaSource(MediaItem.fromUri(rtspUri));
// Create a player instance.
ExoPlayer player = new ExoPlayer.Builder(context).build();
// Set the media source to be played.
player.setMediaSource(mediaSource);
// Prepare the player.
player.prepare();
~~~
{: .language-java}
Custom
`SocketFactory`
instances can be useful when particular routing is required (e.g. when RTSP
traffic needs to pass a specific interface, or the socket needs additional connectivity flags).
## Using RTSP behind a NAT (RTP/TCP support) ##
ExoPlayer uses UDP as the default protocol for RTP transport.
...
...
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