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
405b8114
authored
Oct 29, 2021
by
ibaker
Committed by
tonihei
Nov 01, 2021
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Update developer guide to use non-deprecated symbols
#minor-release PiperOrigin-RevId: 406347412
parent
a0f8ac75
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
27 deletions
docs/ad-insertion.md
docs/drm.md
docs/live-streaming.md
docs/media-items.md
docs/ad-insertion.md
View file @
405b8114
...
@@ -178,7 +178,10 @@ MediaItem preRollAd = MediaItem.fromUri(preRollAdUri);
...
@@ -178,7 +178,10 @@ MediaItem preRollAd = MediaItem.fromUri(preRollAdUri);
MediaItem contentStart =
MediaItem contentStart =
new MediaItem.Builder()
new MediaItem.Builder()
.setUri(contentUri)
.setUri(contentUri)
.setClipEndPositionMs(120_000)
.setClippingConfiguration(
new ClippingConfiguration.Builder()
.setEndPositionMs(120_000)
.build())
.build();
.build();
// A mid-roll ad.
// A mid-roll ad.
MediaItem midRollAd = MediaItem.fromUri(midRollAdUri);
MediaItem midRollAd = MediaItem.fromUri(midRollAdUri);
...
@@ -186,7 +189,10 @@ MediaItem midRollAd = MediaItem.fromUri(midRollAdUri);
...
@@ -186,7 +189,10 @@ MediaItem midRollAd = MediaItem.fromUri(midRollAdUri);
MediaItem contentEnd =
MediaItem contentEnd =
new MediaItem.Builder()
new MediaItem.Builder()
.setUri(contentUri)
.setUri(contentUri)
.setClipStartPositionMs(120_000)
.setClippingConfiguration(
new ClippingConfiguration.Builder()
.setStartPositionMs(120_000)
.build())
.build();
.build();
// Build the playlist.
// Build the playlist.
...
...
docs/drm.md
View file @
405b8114
...
@@ -24,7 +24,8 @@ outlined in the sections below.
...
@@ -24,7 +24,8 @@ outlined in the sections below.
### Key rotation ###
### Key rotation ###
To play streams with rotating keys, pass
`true`
to
To play streams with rotating keys, pass
`true`
to
`MediaItem.Builder.setDrmMultiSession`
when building the media item.
`MediaItem.DrmConfiguration.Builder.setMultiSession`
when building the media
item.
### Multi-key content ###
### Multi-key content ###
...
@@ -49,8 +50,9 @@ to access the different streams.
...
@@ -49,8 +50,9 @@ to access the different streams.
In this case, the license server is configured to respond with only the key
In this case, the license server is configured to respond with only the key
specified in the request. Multi-key content can be played with this license
specified in the request. Multi-key content can be played with this license
server configuration by passing
`true`
to
`MediaItem.Builder.setDrmMultiSession`
server configuration by passing
`true`
to
when building the media item.
`MediaItem.DrmConfiguration.Builder.setMultiSession`
when building the media
item.
We do not recommend configuring your license server to behave in this way. It
We do not recommend configuring your license server to behave in this way. It
requires extra license requests to play multi-key content, which is less
requires extra license requests to play multi-key content, which is less
...
@@ -59,9 +61,9 @@ efficient and robust than the alternative described above.
...
@@ -59,9 +61,9 @@ efficient and robust than the alternative described above.
### Offline keys ###
### Offline keys ###
An offline key set can be loaded by passing the key set ID to
An offline key set can be loaded by passing the key set ID to
`MediaItem.
Builder.setDrmKeySetId`
when building the media item. This
`MediaItem.
DrmConfiguration.Builder.setKeySetId`
when building the media item.
allows playback using the keys stored in the offline key set with the specified
This allows playback using the keys stored in the offline key set with the
ID.
specified
ID.
{% include known-issue-box.html issue-id="3872" description="Only one offline
{% include known-issue-box.html issue-id="3872" description="Only one offline
key set can be specified per playback. As a result, offline playback of
key set can be specified per playback. As a result, offline playback of
...
@@ -75,8 +77,9 @@ clear content as are used when playing encrypted content. When media contains
...
@@ -75,8 +77,9 @@ clear content as are used when playing encrypted content. When media contains
both clear and encrypted sections, you may want to use placeholder
`DrmSessions`
both clear and encrypted sections, you may want to use placeholder
`DrmSessions`
to avoid re-creation of decoders when transitions between clear and encrypted
to avoid re-creation of decoders when transitions between clear and encrypted
sections occur. Use of placeholder
`DrmSessions`
for audio and video tracks can
sections occur. Use of placeholder
`DrmSessions`
for audio and video tracks can
be enabled by passing
`true`
to
`MediaItem.Builder.setDrmSessionForClearPeriods`
be enabled by passing
`true`
to
when building the media item.
`MediaItem.DrmConfiguration.Builder.forceSessionsForAudioAndVideoTracks`
when
building the media item.
### Using a custom DrmSessionManager ###
### Using a custom DrmSessionManager ###
...
...
docs/live-streaming.md
View file @
405b8114
...
@@ -89,7 +89,7 @@ components to support additional modes when playing live streams.
...
@@ -89,7 +89,7 @@ components to support additional modes when playing live streams.
By default, ExoPlayer uses live playback parameters defined by the media. If you
By default, ExoPlayer uses live playback parameters defined by the media. If you
want to configure the live playback parameters yourself, you can set them on a
want to configure the live playback parameters yourself, you can set them on a
per
`MediaItem`
basis by calling
`MediaItem.Builder.setLive
XXX`
methods
. If
per
`MediaItem`
basis by calling
`MediaItem.Builder.setLive
Configuration`
. If
you'd like to set these values globally for all items, you can set them on the
you'd like to set these values globally for all items, you can set them on the
`DefaultMediaSourceFactory`
provided to the player. In both cases, the provided
`DefaultMediaSourceFactory`
provided to the player. In both cases, the provided
values will override parameters defined by the media.
values will override parameters defined by the media.
...
...
docs/media-items.md
View file @
405b8114
...
@@ -86,17 +86,17 @@ To sideload subtitle tracks, `MediaItem.Subtitle` instances can be added when
...
@@ -86,17 +86,17 @@ To sideload subtitle tracks, `MediaItem.Subtitle` instances can be added when
when building a media item:
when building a media item:
~~~
~~~
MediaItem.Subtitle subtitle =
MediaItem.Subtitle
Configuration
subtitle =
new MediaItem.Subtitle
(
new MediaItem.Subtitle
Configuration.Builder(subtitleUri)
subtitleUri,
.setMimeType(MimeTypes.APPLICATION_SUBRIP) // The correct MIME type (required).
MimeTypes.APPLICATION_SUBRIP, // The correct MIME type
.
.setLanguage(language) // The subtitle language (optional)
.
language, // The subtitle language. May be null
.
.setSelectionFlags(selectionFlags) // Selection flags for the track (optional)
.
selectionFlags); // Selection flags for the track.
.build();
MediaItem mediaItem =
MediaItem mediaItem =
new MediaItem.Builder()
new MediaItem.Builder()
.setUri(videoUri)
.setUri(videoUri)
.setSubtitles(Lists.newArrayList
(subtitle))
.setSubtitleConfigurations(ImmutableList.of
(subtitle))
.build();
.build();
~~~
~~~
{: .language-java}
{: .language-java}
...
@@ -110,11 +110,15 @@ It's possible to clip the content referred to by a media item by setting custom
...
@@ -110,11 +110,15 @@ It's possible to clip the content referred to by a media item by setting custom
start and end positions:
start and end positions:
~~~
~~~
MediaItem mediaItem = new MediaItem.Builder()
MediaItem mediaItem =
.setUri(videoUri)
new MediaItem.Builder()
.setClipStartPositionMs(startPositionMs)
.setUri(videoUri)
.setClipEndPositionMs(endPositionMs)
.setClippingConfiguration(
.build();
new ClippingConfiguration.Builder()
.setStartPositionMs(startPositionMs)
.setEndPositionMs(endPositionMs)
.build())
.build();
~~~
~~~
{: .language-java}
{: .language-java}
...
...
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