new MediaComposition()
Represents the composition of media content.
Name | Type | Description |
---|---|---|
chapterUrn | string | URN (Uniform Resource Name) of the associated chapter. |
segmentUrn | string | URN of the associated segment. |
episode | Episode | Associated episode. |
show | Show | Associated show. |
channel | Channel | Associated channel. |
chapterList | Array.<Chapter> | List of associated chapters. |
topicList | Array.<Topic> | List of associated topics. |
analyticsData | Object.<String, String> | Analytics data associated with the media composition. |
analyticsMetadata | Object.<String, String> | Metadata associated with analytics for the media composition. |
Methods
findChapterByUrn(urn) → {Chapter}
Find a chapter by its URN.
Name | Type | Description |
---|---|---|
urn | String |
chapter
- Type:
- Chapter
findMainSegment() → {Segment|undefined}
Return a segment from main chapter following segmentUrn in mediaComposition.
main segment
- Type:
- Segment |
undefined
findResourceListByUrn(urn) → {Array.<Resource>|undefined}
Find resource list by URN.
Name | Type | Description |
---|---|---|
urn | String |
of resources
- Type:
- Array.<Resource> |
undefined
getChapters() → {Array.<Chapter>}
A list of chapters.
of chapters
- Type:
- Array.<Chapter>
getFilteredExternalSubtitles() → {Array.<Subtitle>}
Filter external text tracks that are already available internally.
Rules:
TTML format is filtered
If both are empty that means only internal text tracks will be displayed to the user as they are automatically loaded by the player.
If subtitleInformationList is missing from the MediaComposition and subtitleList is available but the media contains internal text tracks that are also available internally. It will result on a duplication client side.
If subtitleList and subtitleInformationList a merge between both will be operated, removing the external text tracks already available internally.
external text tracks
- Type:
- Array.<Subtitle>
getMainBlockReason() → {string|undefined}
Block reason for main chapter. This also uses current date for STARTDATE.
- See
undefined if main chapter is not blocked
- Type:
- string |
undefined
getMainBlockedSegments() → {Array.<Segment>}
Get blocked segments from the main chapter.
of blocked segments
- Type:
- Array.<Segment>
getMainChapter() → {Chapter}
Get the mediaComposition's main chapter.
- Type:
- Chapter
getMainChapterImageUrl() → {String|undefined}
Get the main chapter's image URL decorated with default width and format.
image URL
- Type:
- String |
undefined
getMainResources() → {Array.<MainResource>}
Get main resources.
array of sources.
- Type:
- Array.<MainResource>
getMainSegments() → {Array.<Segment>}
Get segments of the main chapter ordered by markIn.
of segments
- Type:
- Array.<Segment>
getMainTimeIntervals() → {Array.<TimeInterval>}
Retrieves an array of time intervals associated with the main chapter.
An array of time intervals.
- Type:
- Array.<TimeInterval>
getMainValidFromDate() → {Date}
Compute a date from which this content is valid. Always return a date object.
date specified in media composition or EPOCH when no date present.
- Type:
- Date
getMergedAnalyticsData(analyticsData) → {Object.<string, string>}
Get merged analytics data.
Name | Type | Description |
---|---|---|
analyticsData | Object.<string, string> |
Merged analytics data.
- Type:
- Object.<string, string>
getMergedAnalyticsMetadata(analyticsMetadata) → {Object.<string, string>}
Get merged analytics metadata.
Name | Type | Description |
---|---|---|
analyticsMetadata | Object.<string, string> |
Merged analytics metadata.
- Type:
- Object.<string, string>
getResourceList() → {Array.<Resource>}
Get the chapter's resource list
of resources
- Type:
- Array.<Resource>