Update developer guide to use non-deprecated symbols
#minor-release PiperOrigin-RevId: 406347412
This commit is contained in:
parent
a0f8ac7503
commit
405b811454
@ -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);
|
|||||||
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.
|
||||||
|
19
docs/drm.md
19
docs/drm.md
@ -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.
|
|||||||
|
|
||||||
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.
|
|||||||
### 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
|
|||||||
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 ###
|
||||||
|
|
||||||
|
@ -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.setLiveXXX` methods. If
|
per `MediaItem` basis by calling `MediaItem.Builder.setLiveConfiguration`. 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.
|
||||||
|
@ -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.SubtitleConfiguration subtitle =
|
||||||
new MediaItem.Subtitle(
|
new MediaItem.SubtitleConfiguration.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
|
|||||||
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}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user