MediaInfo.Builder

public static classMediaInfo.BuilderextendsObject

A builder forMediaInfoobjects. MediaInfois used byRemoteMediaPlayer to load media on the receiver application.

Public Constructor Summary

Builder()
Constructs a new Builder.
Builder(StringcontentId)
Constructs a new Builder with the given content ID.
Builder(StringcontentId, String entity)
Constructs a new Builder with the given content ID and entity.

Public Method Summary

MediaInfo
build()
Builds and returns theMediaInfo object.
MediaInfo.Builder
setAdBreakClips(List<AdBreakClipInfo> adBreakClips)
Sets the list ofAdBreakClipInfos, each containing the content of a specific ad.
MediaInfo.Builder
setAdBreaks(List<AdBreakInfo> adBreaks)
Sets the list ofAdBreakInfo,which describes where each ad break is located and whatAdBreakClipInfos each break includes.
MediaInfo.Builder
setAtvEntity(StringatvEntity)
Sets the alternate entity to be used for loading the item on Android TV.
MediaInfo.Builder
setContentType(StringcontentType)
Sets the content (MIME) type.
MediaInfo.Builder
setContentUrl(StringcontentUrl)
Sets the URL of the content to be played.
MediaInfo.Builder
setCustomData(JSONObject customData)
Sets the custom application-specific data.
MediaInfo.Builder
setEntity(Stringentity)
Sets the entity, an application-specific deep link for loading the media.
MediaInfo.Builder
setHlsSegmentFormat(String hlsSegmentFormat)
Sets theHlsSegmentFormat.
MediaInfo.Builder
setHlsVideoSegmentFormat(String hlsVideoSegmentFormat)
MediaInfo.Builder
setMediaTracks(List<MediaTrack> mediaTracks)
Sets the media tracks.
MediaInfo.Builder
setMetadata(MediaMetadata metadata)
Sets the media item metadata.
MediaInfo.Builder
setStreamDuration(long streamDuration)
Sets the stream duration, in milliseconds.
MediaInfo.Builder
setStreamType(int streamType)
Sets the stream type; one of theSTREAM_TYPE_constants.
MediaInfo.Builder
setTextTrackStyle(TextTrackStyle textTrackStyle)
Sets the text track style.
MediaInfo.Builder
setVmapAdsRequest(VastAdsRequest vmapAdsRequest)
VMAP is a collection of VAST ads.

Inherited Method Summary

Public Constructors

publicBuilder()

Constructs a new Builder.

publicBuilder(StringcontentId)

Constructs a new Builder with the given content ID.

publicBuilder(StringcontentId,Stringentity)

Constructs a new Builder with the given content ID and entity.

Public Methods

publicMediaInfo build()

Builds and returns theMediaInfo object.

publicMediaInfo.Builder setAdBreakClips(List<AdBreakClipInfo> adBreakClips)

Sets the list ofAdBreakClipInfos, each containing the content of a specific ad.

publicMediaInfo.Builder setAdBreaks(List<AdBreakInfo> adBreaks)

Sets the list ofAdBreakInfo,which describes where each ad break is located and whatAdBreakClipInfos each break includes.

publicMediaInfo.Builder setAtvEntity(StringatvEntity)

Sets the alternate entity to be used for loading the item on Android TV.

This should be an Android deep link to be used to load media.

If set, this entity will override the value set in setEntity(String)if the receiver is an Android TV app. On the receiver side, the entity can be accessed fromMediaInfo.getEntity().

publicMediaInfo.Builder setContentType(String contentType)

Sets the content (MIME) type. This is a required field.

publicMediaInfo.Builder setContentUrl(String contentUrl)

Sets the URL of the content to be played.

publicMediaInfo.Builder setCustomData(JSONObject customData)

Sets the custom application-specific data.

publicMediaInfo.Builder setEntity(Stringentity)

Sets the entity, an application-specific deep link for loading the media.

publicMediaInfo.Builder setHlsSegmentFormat(String hlsSegmentFormat)

Sets theHlsSegmentFormat.

publicMediaInfo.Builder setHlsVideoSegmentFormat(String hlsVideoSegmentFormat)

publicMediaInfo.Builder setMediaTracks(List<MediaTrack> mediaTracks)

Sets the media tracks.

publicMediaInfo.Builder setMetadata(MediaMetadata metadata)

Sets the media item metadata.

publicMediaInfo.Builder setStreamDuration(long streamDuration)

Sets the stream duration, in milliseconds.

Throws
IllegalArgumentException If the duration is negative.

publicMediaInfo.Builder setStreamType(int streamType)

Sets the stream type; one of theSTREAM_TYPE_constants. This is a required field.

Throws
IllegalArgumentException If the value is not one of the predefined stream type constants.

publicMediaInfo.Builder setTextTrackStyle(TextTrackStyle textTrackStyle)

Sets the text track style.

publicMediaInfo.Builder setVmapAdsRequest(VastAdsRequest vmapAdsRequest)

VMAP is a collection of VAST ads. This is used to load ads ifMediaInfo.getAdBreaks() andMediaInfo.getAdBreakClips() are not provided.