new MediaComposition()
Methods
(static) findDrmListByResource(resource) → {Array}
Find a drm by resource
Parameters:
| Name | Type | Description |
|---|---|---|
resource |
Resource |
Returns:
of drm
- Type
- Array
(static) orderMainResourcesByQuality(resourcesToOrder, quality,) → {Array}
Order the resources by a preferred quality FYI: The [...resourcesToOrder] avoid to mutate the parameter with the sort method
Parameters:
| Name | Type | Description |
|---|---|---|
resourcesToOrder |
Array | array to order |
quality, |
String | the default preferred quality is HD |
- Source:
- See:
-
- SRGQuality all available qualities
Returns:
resources ordered by a preferred quality
- Type
- Array
(static) orderMainResourcesByStreamType(resourcesToOrder, streamType,) → {Array}
Order the stream types by a preferred type FYI: The [...resourcesToOrder] avoid to mutate the parameter with the sort method
Parameters:
| Name | Type | Description |
|---|---|---|
resourcesToOrder |
Array | array to order |
streamType, |
String | the default preferred stream type is DVR |
- Source:
- See:
-
- SRGStreamType all available stream types
Returns:
resources ordered by a preferred stream type
- Type
- Array
filterMainResourcesByQuality(quality) → {Array}
Filter the main resource by quality
Parameters:
| Name | Type | Description |
|---|---|---|
quality |
String | is set to HD by default |
Returns:
filtered resources by quality
- Type
- Array
findChapterByUrn(urn) → {Object}
Find a chapter by his URN
Parameters:
| Name | Type | Description |
|---|---|---|
urn |
String |
Returns:
chapter
- Type
- Object
findMainSegment() → {undefined|*}
Return segment from main chapter following segmentUrn in mediaComposition.
Returns:
- Type
- undefined | *
findResourceListByUrn(urn) → {Array|undefined}
Find resource list by URN
Parameters:
| Name | Type | Description |
|---|---|---|
urn |
String |
Returns:
of resources
- Type
- Array | undefined
getChapters() → {Array}
Chapters as provided by the server
Returns:
of chapters
- Type
- Array
getFilteredExternalSubtitles(logger) → {Array}
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 internaly. 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 internaly.
Parameters:
| Name | Type | Description |
|---|---|---|
logger |
Object |
Returns:
external text tracks
- Type
- Array
getMainBlockReason() → {undefined|String}
Block reason for main chapter. This also uses current date for STARTDATE.
- Source:
- See:
-
- BlockingReason
Returns:
undefined if main chapter is not blocked
- Type
- undefined | String
getMainChapter()
Get the mediaComposition's main chapter
getMainChapterImageUrl() → {String|undefined}
Get the main chapter's image URL decorated with default width and format.
Returns:
image URL.
- Type
- String | undefined
getMainResources(preferredQuality, preferredStreamType) → {Array}
Get videojs formatted main resources
Parameters:
| Name | Type | Description |
|---|---|---|
preferredQuality |
String | set the preferred quality SD, HD, HQ |
preferredStreamType |
String | set the preferred stream type ON_DEMAND, LIVE, DVR |
- Source:
- See:
-
- SRGQuality all available qualities
- SRGStreamType all available stream types
Returns:
array of sources
- Type
- Array
getMainSegments() → {Array}
Get segments of the main chapter ordered by markIn
Returns:
of segments
- Type
- Array
getMainValidFromDate() → {Date}
Compute a date from which this content is valid. Always return a date object.
Returns:
date specified in media composition or EPOCH when no date present.
- Type
- Date
getMergedAnalyticsData() → {Object}
Get merged analytics data
Returns:
- Type
- Object
getMergedAnalyticsMetadata() → {Object}
Get merged analytics metadata
Returns:
- Type
- Object
getResourceList() → {Array}
Get the chapter's resource list
Returns:
of resources
- Type
- Array
getSubdivisions() → {Array}
Get subdivisions to be displayed for this MediaComposition. They can be segments or chapters.
Returns:
of subdivisions
- Type
- Array