MediaStatusModifier

public class MediaStatusModifier extends Object

The modifier to override the base MediaStatus auto-generated from MediaSession, and provide additional status that are not in MediaSession.

The overrides in this class will be used whenever the library needs to generate a MediaStatus.

Public Method Summary

void
clear()
Clears all overrides in the modifier.
AdBreakStatus
getAdBreakStatus()
Returns the AdBreakStatus to override.
JSONObject
getCustomData()
Returns the custom data to override.
Integer
getIdleReason()
Returns the idle reason to override.
MediaLiveSeekableRange
getLiveSeekableRange()
Returns the MediaLiveSeekableRange to override.
Integer
getLoadingItemId()
Returns the ID of the current item being loaded to override.
MediaInfoModifier
getMediaInfoModifier()
Returns the MediaInfoModifier to override fields of the top-level MediaInfo.
MediaTracksModifier
Double
getPlaybackRate()
Returns the playback rate to override.
Integer
getPlayerState()
Returns the player state to override.
Integer
getPreloadedItemId()
Returns the ID of the item that has been preloaded to override.
Long
getStreamPosition()
Returns the stream position to override.
Map<LongBoolean>
getSupportedMediaCommandOverride()
Returns the supported media commands to override.
VideoInfo
getVideoInfo()
Returns the VideoInfo to override.
Boolean
isPlayingAd()
Returns whether the receiver is playing ad to override.
MediaStatusModifier
MediaStatusModifier
setCustomData(JSONObject customData)
Sets the custom data.
MediaStatusModifier
setIdleReason(Integer idleReason)
Sets the idle reason to override the auto-generated value.
MediaStatusModifier
setIsPlayingAd(Boolean isPlayingAd)
Sets whether the receiver is playing ad.
MediaStatusModifier
MediaStatusModifier
setLoadingItemId(Integer loadingItemId)
Sets the ID of the current item being loaded.
MediaStatusModifier
setMediaCommandSupported(long command, Boolean isSupported)
Sets an override to specify whether a media command is supported.
void
setMediaInfoModifier(MediaInfoModifier mediaInfoModifier)
Sets the MediaInfoModifier to override fields of the top-level MediaInfo.
MediaStatusModifier
setPlaybackRate(Double playbackRate)
Sets the playback rate to override the auto-generated value.
MediaStatusModifier
setPlayerState(Integer playerState)
Sets the player state to override the auto-generated value.
MediaStatusModifier
setPreloadedItemId(Integer preloadedItemId)
Sets the ID of the item that has been preloaded.
MediaStatusModifier
setStreamPosition(Long streamPosition)
Sets the stream position to override the auto-generated value.
MediaStatusModifier
setVideoInfo(VideoInfo videoInfo)
Sets the VideoInfo.

Inherited Method Summary

Public Methods

public void clear ()

Clears all overrides in the modifier.

public AdBreakStatus getAdBreakStatus ()

Returns the AdBreakStatus to override.

public JSONObject getCustomData ()

Returns the custom data to override.

public Integer getIdleReason ()

Returns the idle reason to override.

public MediaLiveSeekableRange getLiveSeekableRange ()

Returns the MediaLiveSeekableRange to override.

public Integer getLoadingItemId ()

Returns the ID of the current item being loaded to override.

public MediaInfoModifier getMediaInfoModifier ()

Returns the MediaInfoModifier to override fields of the top-level MediaInfo.

public MediaTracksModifier getMediaTracksModifier ()

Returns the MediaTracksModifier.

public Double getPlaybackRate ()

Returns the playback rate to override.

public Integer getPlayerState ()

Returns the player state to override.

public Integer getPreloadedItemId ()

Returns the ID of the item that has been preloaded to override.

public Long getStreamPosition ()

Returns the stream position to override.

public Map<LongBoolean> getSupportedMediaCommandOverride ()

Returns the supported media commands to override.

public VideoInfo getVideoInfo ()

Returns the VideoInfo to override.

public Boolean isPlayingAd ()

Returns whether the receiver is playing ad to override.

public MediaStatusModifier setAdBreakStatus (AdBreakStatus adBreakStatus)

Sets the AdBreakStatus.

public MediaStatusModifier setCustomData (JSONObject customData)

Sets the custom data.

public MediaStatusModifier setIdleReason (Integer idleReason)

Sets the idle reason to override the auto-generated value.

public MediaStatusModifier setIsPlayingAd (Boolean isPlayingAd)

Sets whether the receiver is playing ad.

public MediaStatusModifier setLiveSeekableRange (MediaLiveSeekableRange liveSeekableRange)

Sets the MediaLiveSeekableRange.

If the seekable range is a moving window, the actual seekable range in the broadcasted MediaStatus will be extrapolated based on the time between when the seekable range is set and when the MediaStatus is generated.

public MediaStatusModifier setLoadingItemId (Integer loadingItemId)

Sets the ID of the current item being loaded.

public MediaStatusModifier setMediaCommandSupported (long command, Boolean isSupported)

Sets an override to specify whether a media command is supported.

Parameters
command the Command to override, which is one of the COMMAND_* constants in MediaStatus.
isSupported whether the command is supported. Specifying null means no override.

public void setMediaInfoModifier (MediaInfoModifier mediaInfoModifier)

Sets the MediaInfoModifier to override fields of the top-level MediaInfo.

public MediaStatusModifier setPlaybackRate (Double playbackRate)

Sets the playback rate to override the auto-generated value.

public MediaStatusModifier setPlayerState (Integer playerState)

Sets the player state to override the auto-generated value.

public MediaStatusModifier setPreloadedItemId (Integer preloadedItemId)

Sets the ID of the item that has been preloaded.

public MediaStatusModifier setStreamPosition (Long streamPosition)

Sets the stream position to override the auto-generated value.

public MediaStatusModifier setVideoInfo (VideoInfo videoInfo)

Sets the VideoInfo.