Google is committed to advancing racial equity for Black communities. See how.

MediaInfoModifier

public class MediaInfoModifier extends Object

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

Public Constructor Summary

Public Method Summary

void
clear()
Clears all overrides.
List<AdBreakClipInfo>
getAdBreakClips()
Returns the list of AdBreakClipInfos to override.
List<AdBreakInfo>
getAdBreaks()
Returns the list of AdBreakInfos 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 of AdBreakClipInfos.
MediaInfoModifier
setAdBreaks(List<AdBreakInfo> adBreaks)
Sets the list of AdBreakInfos.
MediaInfoModifier
setContentId(String contentId)
Sets the content ID to override.
MediaInfoModifier
setContentType(String contentType)
Sets the content (MIME) type.
MediaInfoModifier
setContentUrl(String contentUrl)
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 given MediaInfo.
MediaInfoModifier
setEntity(String entity)
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 MediaMetadataModifier which modifies the metadata of the processed MediaInfo.
MediaInfoModifier
setStartAbsoluteTime(Long startAbsoluteTime)
Sets the start absolute time, in milliseconds in epoch time.
MediaInfoModifier
setStreamDuration(Long streamDuration)
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

public MediaInfoModifier ()

Public Methods

public void clear ()

Clears all overrides.

public List<AdBreakClipInfo> getAdBreakClips ()

Returns the list of AdBreakClipInfos to override.

public List<AdBreakInfo> getAdBreaks ()

Returns the list of AdBreakInfos to override.

public String getContentId ()

Returns the content ID to override.

public String getContentType ()

Returns the content (MIME) type to override.

public String getContentUrl ()

Returns the content URL to override.

public JSONObject getCustomData ()

Returns the custom data to override.

public String getEntity ()

Returns the entity to override.

public List<MediaTrack> getMediaTracks ()

Returns the list of media tracks to override.

public MediaMetadataModifier getMetadataModifier ()

Returns the MediaMetadataModifier.

public Long getStartAbsoluteTime ()

Returns the start absolute time to override.

public Long getStreamDuration ()

Returns the stream duration to override.

public Integer getStreamType ()

Returns the stream type to override.

public TextTrackStyle getTextTrackStyle ()

Returns the text track style to override.

public VastAdsRequest getVmapAdsRequest ()

Returns the VMAP ad request configuration to override.

public MediaInfoModifier setAdBreakClips (List<AdBreakClipInfo> adBreakClips)

Sets the list of AdBreakClipInfos.

public MediaInfoModifier setAdBreaks (List<AdBreakInfo> adBreaks)

Sets the list of AdBreakInfos.

public MediaInfoModifier setContentId (String contentId)

Sets the content ID to override.

The default value is generated from METADATA_KEY_MEDIA_ID or METADATA_KEY_MEDIA_URI. Set to null to disable override.

public MediaInfoModifier setContentType (String contentType)

Sets the content (MIME) type.

public MediaInfoModifier setContentUrl (String contentUrl)

Sets the URL of the content to be played.

public MediaInfoModifier setCustomData (JSONObject customData)

Sets the custom data.

public void setDataFromMediaInfo (MediaInfo mediaInfo)

Sets the data of the modifier from a given MediaInfo.

public MediaInfoModifier setEntity (String entity)

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

public MediaInfoModifier setMediaTracks (List<MediaTrack> mediaTracks)

Sets the list of media tracks.

public void setMetadataModifier (MediaMetadataModifier mediaMetadataModifier)

Sets the MediaMetadataModifier which modifies the metadata of the processed MediaInfo.

public MediaInfoModifier setStartAbsoluteTime (Long startAbsoluteTime)

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

public MediaInfoModifier setStreamDuration (Long streamDuration)

Sets the stream duration to override, in milliseconds.

The default value is generated from METADATA_KEY_DURATION. Set to UNKNOWN_DURATION for live streams. Set to null to disable override.

public MediaInfoModifier setStreamType (Integer streamType)

Sets the stream type to override.

The stream type can be one of the STREAM_TYPE_ constants in MediaInfo. The default value is STREAM_TYPE_BUFFERED. Set to null to disable override.

public MediaInfoModifier setTextTrackStyle (TextTrackStyle textTrackStyle)

Sets the text track style.

public MediaInfoModifier setVmapAdsRequest (VastAdsRequest vmapAdsRequest)

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

See getVmapAdsRequest() for details.