MediaInfo.Builder

public static class MediaInfo.Builder extends Object

A builder for MediaInfo objects. MediaInfo is used by RemoteMediaPlayer to load media on the receiver application.

Public Constructor Summary

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

Public Method Summary

MediaInfo
build()
Builds and returns the MediaInfo object.
MediaInfo.Builder
setAdBreakClips(List<AdBreakClipInfo> adBreakClips)
Sets the list of AdBreakClipInfos, each containing the content of a specific ad.
MediaInfo.Builder
setAdBreaks(List<AdBreakInfo> adBreaks)
Sets the list of AdBreakInfo, which describes where each ad break is located and what AdBreakClipInfos each break includes.
MediaInfo.Builder
setAtvEntity(String atvEntity)
Sets the alternate entity to be used for loading the item on Android TV.
MediaInfo.Builder
setContentType(String contentType)
Sets the content (MIME) type.
MediaInfo.Builder
setContentUrl(String contentUrl)
Sets the URL of the content to be played.
MediaInfo.Builder
setCustomData(JSONObject customData)
Sets the custom application-specific data.
MediaInfo.Builder
setEntity(String entity)
Sets the entity, an application-specific deep link for loading the media.
MediaInfo.Builder
setHlsSegmentFormat(String hlsSegmentFormat)
Sets the HlsSegmentFormat.
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 the STREAM_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

public Builder ()

Constructs a new Builder.

public Builder (String contentId)

Constructs a new Builder with the given content ID.

public Builder (String contentId, String entity)

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

Public Methods

public MediaInfo build ()

Builds and returns the MediaInfo object.

public MediaInfo.Builder setAdBreakClips (List<AdBreakClipInfo> adBreakClips)

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

public MediaInfo.Builder setAdBreaks (List<AdBreakInfo> adBreaks)

Sets the list of AdBreakInfo, which describes where each ad break is located and what AdBreakClipInfos each break includes.

public MediaInfo.Builder setAtvEntity (String atvEntity)

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 from MediaInfo.getEntity().

public MediaInfo.Builder setContentType (String contentType)

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

public MediaInfo.Builder setContentUrl (String contentUrl)

Sets the URL of the content to be played.

public MediaInfo.Builder setCustomData (JSONObject customData)

Sets the custom application-specific data.

public MediaInfo.Builder setEntity (String entity)

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

public MediaInfo.Builder setHlsSegmentFormat (String hlsSegmentFormat)

Sets the HlsSegmentFormat.

public MediaInfo.Builder setHlsVideoSegmentFormat (String hlsVideoSegmentFormat)

public MediaInfo.Builder setMediaTracks (List<MediaTrack> mediaTracks)

Sets the media tracks.

public MediaInfo.Builder setMetadata (MediaMetadata metadata)

Sets the media item metadata.

public MediaInfo.Builder setStreamDuration (long streamDuration)

Sets the stream duration, in milliseconds.

Throws
IllegalArgumentException If the duration is negative.

public MediaInfo.Builder setStreamType (int streamType)

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

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

public MediaInfo.Builder setTextTrackStyle (TextTrackStyle textTrackStyle)

Sets the text track style.

public MediaInfo.Builder setVmapAdsRequest (VastAdsRequest vmapAdsRequest)

VMAP is a collection of VAST ads. This is used to load ads if MediaInfo.getAdBreaks() and MediaInfo.getAdBreakClips() are not provided.