MediaLoadRequestData.Builder

public static class MediaLoadRequestData.Builder extends Object

Builder class for MediaLoadRequestData.

Public Constructor Summary

Builder(MediaLoadRequestData requestData)
Constructor of MediaLoadRequestData.Builder with an argument of MediaLoadRequestData object.

Public Method Summary

MediaLoadRequestData
build()
Builds a MediaLoadRequestData object.
MediaLoadRequestData.Builder
setActiveTrackIds(long[] activeTrackIds)
Sets the array of the active tracks.
MediaLoadRequestData.Builder
setAtvCredentials(String atvCredentials)
Sets the alternate Android TV credentials in the load request.
MediaLoadRequestData.Builder
setAtvCredentialsType(String atvCredentialsType)
Sets the alternate Android TV credentials type in the load request.
MediaLoadRequestData.Builder
setAutoplay(Boolean autoplay)
Sets the value of whether playback should start immediately.
MediaLoadRequestData.Builder
setCredentials(String credentials)
Sets the user credentials to pass along with the load request to the receiver.
MediaLoadRequestData.Builder
setCredentialsType(String credentialsType)
Sets the user credentials type to pass along with the load request to the receiver.
MediaLoadRequestData.Builder
setCurrentTime(long currentTime)
Sets the initial playback position, in milliseconds from the beginning of the stream.
MediaLoadRequestData.Builder
setCustomData(JSONObject customData)
Sets the custom application-specific data to pass along with the load request.
MediaLoadRequestData.Builder
setMediaInfo(MediaInfo mediaInfo)
Sets the MediaInfo of the load request.
MediaLoadRequestData.Builder
setPlaybackRate(double playbackRate)
Sets the playback rate, as the multiplier of the normal playback rate.
MediaLoadRequestData.Builder
setQueueData(MediaQueueData queueData)
Sets the MediaQueueData of the load request.

Inherited Method Summary

Public Constructors

public Builder ()

public Builder (MediaLoadRequestData requestData)

Constructor of MediaLoadRequestData.Builder with an argument of MediaLoadRequestData object.

Public Methods

public MediaLoadRequestData build ()

Builds a MediaLoadRequestData object.

public MediaLoadRequestData.Builder setActiveTrackIds (long[] activeTrackIds)

Sets the array of the active tracks.

public MediaLoadRequestData.Builder setAtvCredentials (String atvCredentials)

Sets the alternate Android TV credentials in the load request.

If set, these credentials will override the value set in setCredentials(String) if the receiver is an Android TV app. On the receiver side, these credentials can be accessed from MediaLoadRequestData.getCredentials().

public MediaLoadRequestData.Builder setAtvCredentialsType (String atvCredentialsType)

Sets the alternate Android TV credentials type in the load request.

If set, this credentials type will override the value set in setCredentialsType(String) if the receiver is an Android TV app. On the receiver side, the credentials type can be accessed from MediaLoadRequestData.getCredentialsType().

public MediaLoadRequestData.Builder setAutoplay (Boolean autoplay)

Sets the value of whether playback should start immediately. The default value is Boolean.TRUE.

When loading a queue by specifying the queue items in setQueueData(MediaQueueData), this value overrides the MediaQueueItem.getAutoplay() property of the first MediaQueueItem to be loaded. Only when this field is null, the MediaQueueItem.getAutoplay() property of individual MediaQueueItems in MediaQueueData will take effect.

When loading a single item by specifying the MediaInfo in setMediaInfo(MediaInfo), this field will specify the playback should start upon load. If null, the playback will not start immediately.

public MediaLoadRequestData.Builder setCredentials (String credentials)

Sets the user credentials to pass along with the load request to the receiver. The credentials are completely application-specific and can be any arbitrary String.

public MediaLoadRequestData.Builder setCredentialsType (String credentialsType)

Sets the user credentials type to pass along with the load request to the receiver. The credentials type is completely application-specific and can be any arbitrary String.

public MediaLoadRequestData.Builder setCurrentTime (long currentTime)

Sets the initial playback position, in milliseconds from the beginning of the stream.

If not set, the receiver will decide the position depending on the stream type. Non-live streams will be loaded from 0 and live streams will be loaded from the most recent position.

public MediaLoadRequestData.Builder setCustomData (JSONObject customData)

Sets the custom application-specific data to pass along with the load request.

public MediaLoadRequestData.Builder setMediaInfo (MediaInfo mediaInfo)

Sets the MediaInfo of the load request.

public MediaLoadRequestData.Builder setPlaybackRate (double playbackRate)

Sets the playback rate, as the multiplier of the normal playback rate. The accepted value is between MediaLoadRequestData.PLAYBACK_RATE_MIN and MediaLoadRequestData.PLAYBACK_RATE_MAX. The normal playback rate is 1.0, which is the default playback rate.

public MediaLoadRequestData.Builder setQueueData (MediaQueueData queueData)

Sets the MediaQueueData of the load request.