diff --git a/docs/ad-insertion.md b/docs/ad-insertion.md index 0886ca6a92..4e42430f5b 100644 --- a/docs/ad-insertion.md +++ b/docs/ad-insertion.md @@ -178,7 +178,10 @@ MediaItem preRollAd = MediaItem.fromUri(preRollAdUri); MediaItem contentStart = new MediaItem.Builder() .setUri(contentUri) - .setClipEndPositionMs(120_000) + .setClippingConfiguration( + new ClippingConfiguration.Builder() + .setEndPositionMs(120_000) + .build()) .build(); // A mid-roll ad. MediaItem midRollAd = MediaItem.fromUri(midRollAdUri); @@ -186,7 +189,10 @@ MediaItem midRollAd = MediaItem.fromUri(midRollAdUri); MediaItem contentEnd = new MediaItem.Builder() .setUri(contentUri) - .setClipStartPositionMs(120_000) + .setClippingConfiguration( + new ClippingConfiguration.Builder() + .setStartPositionMs(120_000) + .build()) .build(); // Build the playlist. diff --git a/docs/drm.md b/docs/drm.md index a943f49ba7..4b64640989 100644 --- a/docs/drm.md +++ b/docs/drm.md @@ -24,7 +24,8 @@ outlined in the sections below. ### Key rotation ### 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 ### @@ -49,8 +50,9 @@ to access the different streams. 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 -server configuration by passing `true` to `MediaItem.Builder.setDrmMultiSession` -when building the media item. +server configuration by passing `true` to +`MediaItem.DrmConfiguration.Builder.setMultiSession` when building the media +item. 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 @@ -59,9 +61,9 @@ efficient and robust than the alternative described above. ### Offline keys ### An offline key set can be loaded by passing the key set ID to -`MediaItem.Builder.setDrmKeySetId` when building the media item. This -allows playback using the keys stored in the offline key set with the specified -ID. +`MediaItem.DrmConfiguration.Builder.setKeySetId` when building the media item. +This allows playback using the keys stored in the offline key set with the +specified ID. {% 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 @@ -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` to avoid re-creation of decoders when transitions between clear and encrypted sections occur. Use of placeholder `DrmSessions` for audio and video tracks can -be enabled by passing `true` to `MediaItem.Builder.setDrmSessionForClearPeriods` -when building the media item. +be enabled by passing `true` to +`MediaItem.DrmConfiguration.Builder.forceSessionsForAudioAndVideoTracks` when +building the media item. ### Using a custom DrmSessionManager ### diff --git a/docs/live-streaming.md b/docs/live-streaming.md index d24d0f4dd0..f9091ba261 100644 --- a/docs/live-streaming.md +++ b/docs/live-streaming.md @@ -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 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 `DefaultMediaSourceFactory` provided to the player. In both cases, the provided values will override parameters defined by the media. diff --git a/docs/media-items.md b/docs/media-items.md index 710ded16d6..f1c342c2a5 100644 --- a/docs/media-items.md +++ b/docs/media-items.md @@ -86,17 +86,17 @@ To sideload subtitle tracks, `MediaItem.Subtitle` instances can be added when when building a media item: ~~~ -MediaItem.Subtitle subtitle = - new MediaItem.Subtitle( - subtitleUri, - MimeTypes.APPLICATION_SUBRIP, // The correct MIME type. - language, // The subtitle language. May be null. - selectionFlags); // Selection flags for the track. - -MediaItem mediaItem = new MediaItem.Builder() - .setUri(videoUri) - .setSubtitles(Lists.newArrayList(subtitle)) - .build(); +MediaItem.SubtitleConfiguration subtitle = + new MediaItem.SubtitleConfiguration.Builder(subtitleUri) + .setMimeType(MimeTypes.APPLICATION_SUBRIP) // The correct MIME type (required). + .setLanguage(language) // The subtitle language (optional). + .setSelectionFlags(selectionFlags) // Selection flags for the track (optional). + .build(); +MediaItem mediaItem = + new MediaItem.Builder() + .setUri(videoUri) + .setSubtitleConfigurations(ImmutableList.of(subtitle)) + .build(); ~~~ {: .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: ~~~ -MediaItem mediaItem = new MediaItem.Builder() - .setUri(videoUri) - .setClipStartPositionMs(startPositionMs) - .setClipEndPositionMs(endPositionMs) - .build(); +MediaItem mediaItem = + new MediaItem.Builder() + .setUri(videoUri) + .setClippingConfiguration( + new ClippingConfiguration.Builder() + .setStartPositionMs(startPositionMs) + .setEndPositionMs(endPositionMs) + .build()) + .build(); ~~~ {: .language-java}