MediaInfoModifier

public classMediaInfoModifierextendsObject

The modifier to override theMediaInfo auto-generated from MediaSession, and provide additional fields that are not in MediaSession.

Public Constructor Summary

MediaInfoModifier()
Constructs an instance of MediaInfoModifier.

Public Method Summary

void
clear()
Clears all overrides.
List<AdBreakClipInfo>
getAdBreakClips()
Returns the list ofAdBreakClipInfos to override.
List<AdBreakInfo>
getAdBreaks()
Returns the list ofAdBreakInfos to override.
String
getContentId()
Returns the content ID to override.
String
getContentType()
Returns the content (MIME) type to override.
String
getContentUrl()
Returns the content URL to override.
JSONObject
getCustomData()
Returns the custom data to override.
String
getEntity()
Returns the entity to override.
List<MediaTrack>
getMediaTracks()
Returns the list of media tracks to override.
MediaMetadataModifier
Long
getStartAbsoluteTime()
Returns the start absolute time to override.
Long
getStreamDuration()
Returns the stream duration to override.
Integer
getStreamType()
Returns the stream type to override.
TextTrackStyle
getTextTrackStyle()
Returns the text track style to override.
VastAdsRequest
getVmapAdsRequest()
Returns the VMAP ad request configuration to override.
MediaInfoModifier
setAdBreakClips(List<AdBreakClipInfo> adBreakClips)
Sets the list ofAdBreakClipInfos.
MediaInfoModifier
setAdBreaks(List<AdBreakInfo> adBreaks)
Sets the list ofAdBreakInfos.
MediaInfoModifier
setContentId(StringcontentId)
Sets the content ID to override.
MediaInfoModifier
setContentType(StringcontentType)
Sets the content (MIME) type.
MediaInfoModifier
setContentUrl(StringcontentUrl)
Sets the URL of the content to be played.
MediaInfoModifier
setCustomData(JSONObject customData)
Sets the custom data.
void
setDataFromMediaInfo(MediaInfo mediaInfo)
Sets the data of the modifier from a givenMediaInfo.
MediaInfoModifier
setEntity(Stringentity)
Sets the entity: a URI that identifies content in an application-specific way.
MediaInfoModifier
setMediaTracks(List<MediaTrack> mediaTracks)
Sets the list of media tracks.
void
setMetadataModifier(MediaMetadataModifier mediaMetadataModifier)
Sets the MediaMetadataModifierwhich modifies the metadata of the processed MediaInfo.
MediaInfoModifier
setStartAbsoluteTime(Long startAbsoluteTime)
Sets the start absolute time, in milliseconds in epoch time.
MediaInfoModifier
setStreamDuration(LongstreamDuration)
Sets the stream duration to override, in milliseconds.
MediaInfoModifier
setStreamType(Integer streamType)
Sets the stream type to override.
MediaInfoModifier
setTextTrackStyle(TextTrackStyle textTrackStyle)
Sets the text track style.
MediaInfoModifier
setVmapAdsRequest(VastAdsRequest vmapAdsRequest)
Sets the VMAP ad request configuration, which is a collection of VAST ads.

Inherited Method Summary

Public Constructors

publicMediaInfoModifier()

Constructs an instance ofMediaInfoModifier.

Public Methods

public voidclear()

Clears all overrides.

publicList<AdBreakClipInfo> getAdBreakClips()

Returns the list ofAdBreakClipInfos to override.

publicList<AdBreakInfo> getAdBreaks()

Returns the list ofAdBreakInfos to override.

publicStringgetContentId()

Returns the content ID to override.

publicStringgetContentType()

Returns the content (MIME) type to override.

publicStringgetContentUrl()

Returns the content URL to override.

publicJSONObject getCustomData()

Returns the custom data to override.

publicStringgetEntity()

Returns the entity to override.

publicList<MediaTrack> getMediaTracks()

Returns the list of media tracks to override.

publicMediaMetadataModifier getMetadataModifier()

Returns theMediaMetadataModifier.

publicLonggetStartAbsoluteTime()

Returns the start absolute time to override.

publicLonggetStreamDuration()

Returns the stream duration to override.

publicIntegergetStreamType()

Returns the stream type to override.

publicTextTrackStyle getTextTrackStyle()

Returns the text track style to override.

publicVastAdsRequest getVmapAdsRequest()

Returns the VMAP ad request configuration to override.

publicMediaInfoModifier setAdBreakClips(List<AdBreakClipInfo> adBreakClips)

Sets the list ofAdBreakClipInfos.

publicMediaInfoModifier setAdBreaks(List<AdBreakInfo> adBreaks)

Sets the list ofAdBreakInfos.

publicMediaInfoModifier setContentId(StringcontentId)

Sets the content ID to override.

The default value is generated from MediaMetadataCompat.METADATA_KEY_MEDIA_IDor MediaMetadataCompat.METADATA_KEY_MEDIA_URI.Set tonullto disable override.

publicMediaInfoModifier setContentType(String contentType)

Sets the content (MIME) type.

publicMediaInfoModifier setContentUrl(String contentUrl)

Sets the URL of the content to be played.

publicMediaInfoModifier setCustomData(JSONObject customData)

Sets the custom data.

public voidsetDataFromMediaInfo(MediaInfo mediaInfo)

Sets the data of the modifier from a givenMediaInfo.

If the givenMediaInfois null,all overrides will be cleared.

publicMediaInfoModifier setEntity(Stringentity)

Sets the entity: a URI that identifies content in an application-specific way.

publicMediaInfoModifier setMediaTracks(List<MediaTrack> mediaTracks)

Sets the list of media tracks.

public voidsetMetadataModifier(MediaMetadataModifier mediaMetadataModifier)

Sets theMediaMetadataModifier which modifies the metadata of the processedMediaInfo.

publicMediaInfoModifier setStartAbsoluteTime(Long startAbsoluteTime)

Sets the start absolute time, in milliseconds in epoch time.

publicMediaInfoModifier setStreamDuration(Long streamDuration)

Sets the stream duration to override, in milliseconds.

The default value is generated from MediaMetadataCompat.METADATA_KEY_DURATION.Set toMediaInfo.UNKNOWN_DURATION for live streams. Set tonullto disable override.

publicMediaInfoModifier setStreamType(Integer streamType)

Sets the stream type to override.

The stream type can be one of theSTREAM_TYPE_constants in MediaInfo. The default value isMediaInfo.STREAM_TYPE_BUFFERED. Set tonullto disable override.

publicMediaInfoModifier setTextTrackStyle(TextTrackStyle textTrackStyle)

Sets the text track style.

publicMediaInfoModifier setVmapAdsRequest(VastAdsRequest vmapAdsRequest)

Sets the VMAP ad request configuration, which is a collection of VAST ads.

SeeMediaInfo.getVmapAdsRequest() for details.