| Modifier and Type | Field and Description |
|---|---|
protected String |
contentId
Typically the URL of the media
|
protected String |
contentType
The content MIME-type
|
protected String |
contentUrl
Optional media URL, to allow using
contentId for real ID. |
protected Map<String,Object> |
customData
Application-specific media information
|
protected Double |
duration
The media duration
|
protected String |
entity
Optional Google Assistant deep link to a media entity
|
protected Media.HlsSegmentFormat |
hlsSegmentFormat
The format of the HLS audio segment
|
protected Media.HlsVideoSegmentFormat |
hlsVideoSegmentFormat
The format of the HLS video segment
|
protected Media.MediaCategory |
mediaCategory
The media category (audio, video, picture)
|
protected Map<String,Object> |
metadata
The media metadata
|
protected Long |
startAbsoluteTime
Provides absolute time (Epoch Unix time in seconds) for live streams.
|
protected Media.StreamType |
streamType
The stream type (required)
|
protected TextTrackStyle |
textTrackStyle
The style of text track
|
protected List<Track> |
tracks
The media tracks
|
| Modifier | Constructor and Description |
|---|---|
|
MediaBuilder(String contentUrl,
String contentType,
Media.StreamType streamType)
Creates a new instance using the specified parameters.
|
protected |
MediaBuilder(String contentId,
String contentType,
String contentUrl,
Map<String,Object> customData,
Double duration,
String entity,
Media.HlsSegmentFormat hlsSegmentFormat,
Media.HlsVideoSegmentFormat hlsVideoSegmentFormat,
Media.MediaCategory mediaCategory,
Map<String,Object> metadata,
Long startAbsoluteTime,
Media.StreamType streamType,
TextTrackStyle textTrackStyle,
List<Track> tracks)
"modify()" constructor that simply copies an existing
Media
instance's fields. |
@Nullable protected String contentUrl
contentId for real ID. If
contentUrl is provided, it will be used as media the URL,
otherwise contentId will be used as the media URL.@Nullable protected Media.HlsSegmentFormat hlsSegmentFormat
@Nullable protected Media.HlsVideoSegmentFormat hlsVideoSegmentFormat
@Nullable protected Media.MediaCategory mediaCategory
@Nullable protected Long startAbsoluteTime
@Nonnull protected Media.StreamType streamType
@Nullable protected TextTrackStyle textTrackStyle
public MediaBuilder(@Nullable String contentUrl, @Nonnull String contentType, @Nonnull Media.StreamType streamType)
contentUrl - the URL of the media content.contentType - the content MIME-type.streamType - the stream type.protected MediaBuilder(@Nonnull String contentId, @Nonnull String contentType, @Nullable String contentUrl, @Nullable Map<String,Object> customData, @Nullable Double duration, @Nullable String entity, @Nullable Media.HlsSegmentFormat hlsSegmentFormat, @Nullable Media.HlsVideoSegmentFormat hlsVideoSegmentFormat, @Nullable Media.MediaCategory mediaCategory, @Nullable Map<String,Object> metadata, @Nullable Long startAbsoluteTime, @Nonnull Media.StreamType streamType, @Nullable TextTrackStyle textTrackStyle, @Nullable List<Track> tracks)
Media
instance's fields.contentId - the content ID, typically the URL of the media.contentType - the content MIME-type.contentUrl - the optional media URL, to allow using
contentId for real ID. If contentUrl is
provided, it will be used as media the URL, otherwise
contentId will be used as the media URL.customData - the application-specific media information.duration - the media duration.entity - the optional Google Assistant deep link to a media
entity.hlsSegmentFormat - the format of the HLS audio segment.hlsVideoSegmentFormat - the format of the HLS video segment.mediaCategory - the media category.metadata - the media metadata.startAbsoluteTime - the absolute time (Epoch Unix time in
seconds) for live streams. For live event it would be the
time the event started, otherwise it will be start of the
seekable range when the streaming started.streamType - the stream type.textTrackStyle - the style of text track.tracks - the media tracks.@Nonnull public String contentId()
@Nonnull public Media.MediaBuilder contentId(@Nonnull String contentId)
contentId - the content ID, typically the URL of the media.Media.MediaBuilder.@Nonnull public Media.MediaBuilder contentTypeId(@Nonnull String contentType)
contentType - the content MIME-type.Media.MediaBuilder.@Nullable public String contentUrl()
contentId for
real ID. If contentUrl is provided, it will be used
as media the URL, otherwise contentId will be used as
the media URL.@Nonnull public Media.MediaBuilder contentUrl(@Nullable String contentUrl)
contentUrl - the optional media URL, to allow using
contentId for real ID. If contentUrl is
provided, it will be used as media the URL, otherwise
contentId will be used as the media URL.Media.MediaBuilder.@Nullable public Map<String,Object> customData()
@Nonnull public Media.MediaBuilder customData(@Nullable Map<String,Object> customData)
customData - the application-specific media information.Media.MediaBuilder.@Nonnull public Media.MediaBuilder duration(@Nullable Double duration)
duration - the media duration.Media.MediaBuilder.@Nullable public String entity()
@Nonnull public Media.MediaBuilder entity(@Nullable String entity)
entity - the optional Google Assistant deep link to a media
entity.Media.MediaBuilder.@Nullable public Media.HlsSegmentFormat hlsSegmentFormat()
@Nonnull public Media.MediaBuilder hlsSegmentFormat(@Nullable Media.HlsSegmentFormat hlsSegmentFormat)
hlsSegmentFormat - the format of the HLS audio segment.Media.MediaBuilder.@Nullable public Media.HlsVideoSegmentFormat hlsVideoSegmentFormat()
@Nonnull public Media.MediaBuilder hlsVideoSegmentFormat(@Nullable Media.HlsVideoSegmentFormat hlsVideoSegmentFormat)
hlsVideoSegmentFormat - the format of the HLS video segment.Media.MediaBuilder.@Nullable public Media.MediaCategory mediaCategory()
@Nonnull public Media.MediaBuilder mediaCategory(@Nullable Media.MediaCategory mediaCategory)
mediaCategory - the media category.Media.MediaBuilder.@Nonnull public Media.MediaBuilder metadata(@Nullable Map<String,Object> metadata)
metadata - the media metadata.Media.MediaBuilder.@Nullable public Long startAbsoluteTime()
@Nonnull public Media.MediaBuilder startAbsoluteTime(@Nullable Long startAbsoluteTime)
startAbsoluteTime - the absolute time (Epoch Unix time in
seconds) for live streams. For live event it would be the
time the event started, otherwise it will be start of the
seekable range when the streaming started.Media.MediaBuilder.@Nonnull public Media.StreamType streamType()
@Nonnull public Media.MediaBuilder streamType(@Nonnull Media.StreamType streamType)
streamType - the stream type.Media.MediaBuilder.@Nullable public TextTrackStyle textTrackStyle()
@Nonnull public Media.MediaBuilder textTrackStyle(@Nullable TextTrackStyle textTrackStyle)
textTrackStyle - the style of text track.Media.MediaBuilder.@Nonnull public Media.MediaBuilder addTrack(@Nullable Track track)
Track to the end of this
Media.MediaBuilder's tracks. If tracks is null, a
new ArrayList is created first.track - the Track to add.Media.MediaBuilder.@Nonnull public Media.MediaBuilder addTrack(int index, @Nullable Track track)
Track at the specified position in this
Media.MediaBuilder's tracks. If tracks is null, a
new ArrayList is created first.index - the index where the Track should be inserted.track - the Track to add.Media.MediaBuilder.@Nonnull public Media.MediaBuilder clearTracks()
Media.MediaBuilder.Media.MediaBuilder.@Nonnull public Media.MediaBuilder removeTrack(int index)
Track at the specified position in this
Media.MediaBuilder.index - the index of the Track to be removed.Media.MediaBuilder.IndexOutOfBoundsException - If the index is out of
range.@Nonnull public Media.MediaBuilder removeTrack(@Nullable Track track)
Track from this
Media.MediaBuilder, if it's present.track - the Track to remove.Media.MediaBuilder.@Nonnull public Media.MediaBuilder tracks(@Nullable List<Track> tracks)
tracks - the media Tracks.Media.MediaBuilder.@Nonnull public Media build()
Media instance with the content from this
Media.MediaBuilder.Copyright © 2022. All rights reserved.