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 Constructors

public MediaInfo.Builder (String contentId)

Constructs a new Builder with the given content ID.

IllegalArgumentException If the content ID is null or empty.

Public Methods

public MediaInfo build ()

Builds and returns the MediaInfo object.

IllegalArgumentException If all required fields have not been populated with valid values.

public MediaInfo.Builder setContentType (String contentType)

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

IllegalArgumentException If the content type is null or empty.

public MediaInfo.Builder setCustomData (JSONObject customData)

Sets the custom application-specific data.

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 duration)

Sets the stream duration, in milliseconds.

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.

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

public MediaInfo.Builder setTextTrackStyle (TextTrackStyle textTrackStyle)

Sets the text track style.