@srgssr/pillarbox-web 1.17.0 → 1.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/pillarbox-core.cjs.js +11 -6
- package/dist/pillarbox-core.cjs.js.map +1 -1
- package/dist/pillarbox-core.es.js +11 -6
- package/dist/pillarbox-core.es.js.map +1 -1
- package/dist/pillarbox.cjs.js +144 -111
- package/dist/pillarbox.cjs.js.map +1 -1
- package/dist/pillarbox.es.js +145 -112
- package/dist/pillarbox.es.js.map +1 -1
- package/dist/pillarbox.umd.js +144 -111
- package/dist/pillarbox.umd.js.map +1 -1
- package/dist/pillarbox.umd.min.js +1 -1
- package/dist/pillarbox.umd.min.js.map +1 -1
- package/dist/types/build.es.d.ts +5 -1
- package/dist/types/build.es.d.ts.map +1 -1
- package/dist/types/src/components/player.d.ts +7 -8
- package/dist/types/src/components/player.d.ts.map +1 -1
- package/dist/types/src/dataProvider/model/MediaComposition.d.ts +12 -0
- package/dist/types/src/dataProvider/model/MediaComposition.d.ts.map +1 -1
- package/dist/types/src/dataProvider/services/DataProvider.d.ts +3 -3
- package/dist/types/src/dataProvider/services/DataProvider.d.ts.map +1 -1
- package/dist/types/src/middleware/srgssr.d.ts +76 -73
- package/dist/types/src/middleware/srgssr.d.ts.map +1 -1
- package/dist/types/src/trackers/PillarboxMonitoring.d.ts +15 -8
- package/dist/types/src/trackers/PillarboxMonitoring.d.ts.map +1 -1
- package/dist/types/src/trackers/SRGAnalytics.d.ts +55 -55
- package/dist/types/src/trackers/SRGAnalytics.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/types/src/components/typedef.d.ts +0 -14
- package/dist/types/src/components/typedef.d.ts.map +0 -1
- package/dist/types/src/middleware/typedef.d.ts +0 -67
- package/dist/types/src/middleware/typedef.d.ts.map +0 -1
package/dist/pillarbox.umd.js
CHANGED
|
@@ -110,7 +110,7 @@
|
|
|
110
110
|
return target;
|
|
111
111
|
}
|
|
112
112
|
|
|
113
|
-
const version$8 = "1.
|
|
113
|
+
const version$8 = "1.18.0";
|
|
114
114
|
|
|
115
115
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
116
116
|
|
|
@@ -71477,9 +71477,14 @@ ${segmentInfoString(segmentInfo)}`); // If there's an init segment associated wi
|
|
|
71477
71477
|
|
|
71478
71478
|
eme.VERSION = version;
|
|
71479
71479
|
|
|
71480
|
+
/** @import VJSPlayer from 'video.js/dist/types/player' */
|
|
71481
|
+
/** @import AudioTrack from 'video.js/dist/types/tracks/audio-track' */
|
|
71482
|
+
/** @import TextTrack from 'video.js/dist/types/tracks/text-track' */
|
|
71483
|
+
/** @import {TrackSelector} from './typedef' */
|
|
71484
|
+
|
|
71480
71485
|
/**
|
|
71481
71486
|
* @ignore
|
|
71482
|
-
* @type {typeof
|
|
71487
|
+
* @type {typeof VJSPlayer}
|
|
71483
71488
|
*/
|
|
71484
71489
|
const vjsPlayer = videojs.getComponent('player');
|
|
71485
71490
|
|
|
@@ -71514,7 +71519,7 @@ ${segmentInfoString(segmentInfo)}`); // If there's an init segment associated wi
|
|
|
71514
71519
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/AudioTrack/kind
|
|
71515
71520
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/AudioTrack/language
|
|
71516
71521
|
*
|
|
71517
|
-
* @param {
|
|
71522
|
+
* @param {TrackSelector} [trackSelector]
|
|
71518
71523
|
*
|
|
71519
71524
|
* @example
|
|
71520
71525
|
* // Get the current audio track
|
|
@@ -71528,7 +71533,7 @@ ${segmentInfoString(segmentInfo)}`); // If there's an init segment associated wi
|
|
|
71528
71533
|
* // Activate first audio track found corresponding to language
|
|
71529
71534
|
* player.audioTrack({language:'fr'});
|
|
71530
71535
|
*
|
|
71531
|
-
* @return {
|
|
71536
|
+
* @return {AudioTrack | undefined} The
|
|
71532
71537
|
* currently enabled audio track. See {@link https://docs.videojs.com/audiotrack}.
|
|
71533
71538
|
*/
|
|
71534
71539
|
audioTrack(trackSelector) {
|
|
@@ -71638,7 +71643,7 @@ ${segmentInfoString(segmentInfo)}`); // If there's an init segment associated wi
|
|
|
71638
71643
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/TextTrack/kind
|
|
71639
71644
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/textTrack/language
|
|
71640
71645
|
*
|
|
71641
|
-
* @param {
|
|
71646
|
+
* @param {TrackSelector} [trackSelector]
|
|
71642
71647
|
*
|
|
71643
71648
|
* @example
|
|
71644
71649
|
* // Get the current text track
|
|
@@ -71657,7 +71662,7 @@ ${segmentInfoString(segmentInfo)}`); // If there's an init segment associated wi
|
|
|
71657
71662
|
* // Activate first text track found corresponding to language
|
|
71658
71663
|
* player.textTrack({language:'fr'});
|
|
71659
71664
|
*
|
|
71660
|
-
* @return {
|
|
71665
|
+
* @return {TextTrack | undefined} The
|
|
71661
71666
|
* currently enabled text track. See {@link https://docs.videojs.com/texttrack}.
|
|
71662
71667
|
*/
|
|
71663
71668
|
textTrack(trackSelector) {
|
|
@@ -71776,10 +71781,11 @@ ${segmentInfoString(segmentInfo)}`); // If there's an init segment associated wi
|
|
|
71776
71781
|
*/
|
|
71777
71782
|
pillarbox.options.trackers = {};
|
|
71778
71783
|
|
|
71784
|
+
/** @import MediaComposition from '../model/MediaComposition.js' */
|
|
71785
|
+
|
|
71779
71786
|
/**
|
|
71780
71787
|
* Represents a data provider for constructing URLs and handling requests.
|
|
71781
71788
|
* @class
|
|
71782
|
-
* @ignore
|
|
71783
71789
|
*/
|
|
71784
71790
|
class DataProvider {
|
|
71785
71791
|
/**
|
|
@@ -71807,7 +71813,7 @@ ${segmentInfoString(segmentInfo)}`); // If there's an init segment associated wi
|
|
|
71807
71813
|
*
|
|
71808
71814
|
* @param {Function} urlHandler A function that constructs the URL
|
|
71809
71815
|
*
|
|
71810
|
-
* @returns {Promise<
|
|
71816
|
+
* @returns {Promise<MediaComposition>} A promise with the fetched data
|
|
71811
71817
|
*/
|
|
71812
71818
|
handleRequest(urlHandler) {
|
|
71813
71819
|
var _this = this;
|
|
@@ -71819,7 +71825,7 @@ ${segmentInfoString(segmentInfo)}`); // If there's an init segment associated wi
|
|
|
71819
71825
|
throw response;
|
|
71820
71826
|
}
|
|
71821
71827
|
|
|
71822
|
-
/** @type {
|
|
71828
|
+
/** @type {MediaComposition} */
|
|
71823
71829
|
const data = yield response.json();
|
|
71824
71830
|
return data;
|
|
71825
71831
|
});
|
|
@@ -72208,67 +72214,65 @@ ${segmentInfoString(segmentInfo)}`); // If there's an init segment associated wi
|
|
|
72208
72214
|
*/
|
|
72209
72215
|
const WAITING = 'waiting';
|
|
72210
72216
|
|
|
72217
|
+
/** @import Player from 'video.js/dist/types/player' */
|
|
72218
|
+
|
|
72211
72219
|
/* eslint max-lines-per-function: ["error", 200] */
|
|
72212
72220
|
/* eslint max-statements: ["error", 20]*/
|
|
72213
72221
|
/* eslint complexity: ["error", 10]*/
|
|
72222
|
+
|
|
72214
72223
|
/**
|
|
72215
|
-
* SRG analytics
|
|
72216
|
-
* @class SRGAnalytics
|
|
72217
|
-
* @ignore
|
|
72224
|
+
* The SRG analytics class tracks media playback according to the standard defined by SRG SSR.
|
|
72218
72225
|
*
|
|
72219
|
-
*
|
|
72220
|
-
* JS script : https://colibri-js.akamaized.net/penguin/tc_SRGGD_11.js
|
|
72226
|
+
* @class SRGAnalytics
|
|
72221
72227
|
*
|
|
72222
72228
|
* ### Official documentation
|
|
72223
|
-
* Variables list
|
|
72224
|
-
* @see https://confluence.srg.beecollaboration.com/display/INTFORSCHUNG/Datalayer+for+media+players
|
|
72225
72229
|
*
|
|
72226
|
-
*
|
|
72227
|
-
* @
|
|
72230
|
+
* - [New variable list]{@link https://srgssr-ch.atlassian.net/wiki/spaces/INTFORSCHUNG/pages/1009353309/Labels+check+for+migration+of+integration+layer+in+SAM}
|
|
72231
|
+
* - [Variables list]{@link https://srgssr-ch.atlassian.net/wiki/spaces/INTFORSCHUNG/pages/795904478/Datalayer+for+media+players}
|
|
72232
|
+
* - [Standard event sequences]{@link https://srgssr-ch.atlassian.net/wiki/spaces/INTFORSCHUNG/pages/795904171/standard+streaming+events+sequence+of+events+for+media+player+actions}
|
|
72233
|
+
* - [Review of Standard Media Actions]{@link https://srgssr-ch.atlassian.net/wiki/spaces/INTFORSCHUNG/pages/795902249/Implementation+Concept+-+draft}
|
|
72234
|
+
* - [ComScore Implementation Guide]{@link https://www.dropbox.com/sh/cdwuikq0abxi21m/AABmSyXYKUTWSAwRZgQA9Ujna/JavaScript%20Latest%20Version?dl=0&preview=Comscore_Library-JavaScript-Streaming_Tag-Implementation_Guide-International.pdf&subfolder_nav_tracking=1}
|
|
72228
72235
|
*
|
|
72229
|
-
*
|
|
72230
|
-
* @see https://confluence.srg.beecollaboration.com/display/INTFORSCHUNG/Implementation+Concept+-+draft
|
|
72236
|
+
* ### Script URL
|
|
72231
72237
|
*
|
|
72232
|
-
*
|
|
72233
|
-
* @see https://www.dropbox.com/sh/cdwuikq0abxi21m/AABmSyXYKUTWSAwRZgQA9Ujna/JavaScript%20Latest%20Version?dl=0&preview=Comscore_Library-JavaScript-Streaming_Tag-Implementation_Guide-International.pdf&subfolder_nav_tracking=1
|
|
72238
|
+
* JS script : https://colibri-js.akamaized.net/penguin/tc_SRGGD_11.js
|
|
72234
72239
|
*
|
|
72235
72240
|
* ### Variables list
|
|
72236
|
-
* - 'event_id', // init | play | stop | pos | pause | seek | uptime | eof
|
|
72237
|
-
* - 'event_timestamp', // Seems to be generated automatically from the documentation, but the TP overrides it
|
|
72238
|
-
* - 'event_name', // NA TP seems to not sending this variable
|
|
72239
|
-
* - 'event_source', // NA TP seems to not sending this variable
|
|
72240
|
-
* - 'event_name', // NA TP seems to not sending this variable
|
|
72241
|
-
* - 'event_value', // NA TP seems to not sending this variable
|
|
72242
|
-
* - 'navigation_environment', // prod | preprod
|
|
72243
|
-
* - 'media_subtitles_on', // string true | false
|
|
72244
|
-
* - 'media_timeshift', // need better description
|
|
72245
|
-
* - 'media_quality', // SD | HD ?
|
|
72246
|
-
* - 'media_bandwidth', // NA for the web, 64000
|
|
72247
|
-
* - 'media_volume', // from 0 to 100
|
|
72248
|
-
* - 'media_embedding_url', //
|
|
72249
|
-
* - 'media_player_name', // videojs | letterbox-web ?
|
|
72250
|
-
* - 'media_chromecast_selected', // boolean true | false
|
|
72251
|
-
* - 'media_player_version', // player's version
|
|
72252
|
-
* - 'media_player_display', // is the player mode, on the TP : inline, embed etc..
|
|
72253
|
-
* - 'media_audio_track', // NA
|
|
72254
|
-
* - 'media_position_real', // NA
|
|
72255
|
-
* - 'media_time_spent', // NA
|
|
72256
|
-
* - 'device_id', // NA
|
|
72257
|
-
* - 'user_id_log_in', // NA only RTS has log in today
|
|
72258
|
-
* - 'media_thumbnail', // Not required by the spec but sended by the TP
|
|
72259
|
-
* - 'media_bu_distributer', // Not required by the spec but sended by the TP
|
|
72260
72241
|
*
|
|
72242
|
+
* - event_id: init | play | stop | pos | pause | seek | uptime | eof
|
|
72243
|
+
* - event_timestamp: Seems to be generated automatically from the documentation, but the TP overrides it
|
|
72244
|
+
* - event_name: NA TP seems to not sending this variable
|
|
72245
|
+
* - event_source: NA TP seems to not sending this variable
|
|
72246
|
+
* - event_name: NA TP seems to not sending this variable
|
|
72247
|
+
* - event_value: NA TP seems to not sending this variable
|
|
72248
|
+
* - navigation_environment: prod | preprod
|
|
72249
|
+
* - media_subtitles_on: string true | false
|
|
72250
|
+
* - media_timeshift: need better description
|
|
72251
|
+
* - media_quality: SD | HD ?
|
|
72252
|
+
* - media_bandwidth: NA for the web, 64000
|
|
72253
|
+
* - media_volume: from 0 to 100
|
|
72254
|
+
* - media_embedding_url:
|
|
72255
|
+
* - media_player_name: videojs | letterbox-web ?
|
|
72256
|
+
* - media_chromecast_selected: boolean true | false
|
|
72257
|
+
* - media_player_version: player's version
|
|
72258
|
+
* - media_player_display: is the player mode, on the TP : inline, embed etc..
|
|
72259
|
+
* - media_audio_track: NA
|
|
72260
|
+
* - media_position_real: NA
|
|
72261
|
+
* - media_time_spent: NA
|
|
72262
|
+
* - device_id: NA
|
|
72263
|
+
* - user_id_log_in: NA only RTS has log in today
|
|
72264
|
+
* - media_thumbnail: Not required by the spec but sended by the TP
|
|
72265
|
+
* - media_bu_distributer: Not required by the spec but sended by the TP
|
|
72261
72266
|
*
|
|
72262
72267
|
* ### Sequence stories
|
|
72263
72268
|
*
|
|
72264
|
-
*
|
|
72269
|
+
* #### Story 1 (AoD/VOD-basics): A VoD is played. The user does not interact with the player. The VoD plays to its end.
|
|
72265
72270
|
*
|
|
72266
72271
|
* Hints:
|
|
72267
72272
|
* - Media sessions always start with PLAY. They end with STOP or EOF (or with PAUSE or last POS)
|
|
72268
72273
|
* - POS is sent ever 30s
|
|
72269
72274
|
*
|
|
72270
|
-
*
|
|
72271
|
-
* __Story 2 (livestream-basics A)__: A Livestream is played. The user does not interact with the player. After 61 seconds, playback is paused.
|
|
72275
|
+
* #### Story 2 (livestream-basics A): A Livestream is played. The user does not interact with the player. After 61 seconds, playback is paused.
|
|
72272
72276
|
*
|
|
72273
72277
|
* Hints:
|
|
72274
72278
|
* - Media sessions always start with PLAY. They end with STOP (or, worse for data quailty, with PAUSE or last POS/UPTIME)
|
|
@@ -72276,14 +72280,12 @@ ${segmentInfoString(segmentInfo)}`); // If there's an init segment associated wi
|
|
|
72276
72280
|
* - POS is sent ever 30s, UPTIME every 60s with inital UPTIME after 30s.
|
|
72277
72281
|
* - This is the interval: 30s: POS + UPTIME; 60s: POS; 90s: POS + UPTIME; ...
|
|
72278
72282
|
*
|
|
72279
|
-
*
|
|
72280
|
-
* __Story 3 (Seeking a VoD/AoD)__: A VoD is played. User seeks in the VoD/AoD.
|
|
72283
|
+
* #### Story 3 (Seeking a VoD/AoD): A VoD is played. User seeks in the VoD/AoD.
|
|
72281
72284
|
*
|
|
72282
72285
|
* Hints:
|
|
72283
72286
|
* - Once the Media Player slider is released (seek is over), another action to finish up the seeking is initiated. Typically this is PLAY. For that second PLAY, the media position has altered.
|
|
72284
72287
|
*
|
|
72285
|
-
*
|
|
72286
|
-
* __Story 4 (Seeking a livestream)__: A Livestream is played. User goes back in the livestream.
|
|
72288
|
+
* #### Story 4 (Seeking a livestream): A Livestream is played. User goes back in the livestream.
|
|
72287
72289
|
*
|
|
72288
72290
|
* Hints:
|
|
72289
72291
|
* - Once the Media Player slider is released (seek is over), another action to finish up the seeking is initiated. Typically this is PLAY. For that second PLAY, the a new variable, media_timeshift is passed.
|
|
@@ -72292,6 +72294,17 @@ ${segmentInfoString(segmentInfo)}`); // If there's an init segment associated wi
|
|
|
72292
72294
|
* 2. The value of media_position is '1'.
|
|
72293
72295
|
*/
|
|
72294
72296
|
class SRGAnalytics {
|
|
72297
|
+
/**
|
|
72298
|
+
* Creates an instance of SRGAnalytics.
|
|
72299
|
+
*
|
|
72300
|
+
* @constructor
|
|
72301
|
+
* @param {Player} player The player instance
|
|
72302
|
+
* @param {SRGAnalyticsOptions} [options={}] Configuration options
|
|
72303
|
+
* @param {boolean} [options.debug=false] Enables debug mode if set to true
|
|
72304
|
+
* @param {string} [options.environment='prod'] The environment in which the data is sent
|
|
72305
|
+
* @param {string} [options.playerVersion='none'] The version of the player
|
|
72306
|
+
* @param {string} [options.tagCommanderScriptURL='//colibri-js.akamaized.net/penguin/tc_SRGGD_11.js'] The URL for the Tag Commander script
|
|
72307
|
+
*/
|
|
72295
72308
|
constructor(player, {
|
|
72296
72309
|
debug = false,
|
|
72297
72310
|
environment = 'prod',
|
|
@@ -73019,6 +73032,8 @@ ${segmentInfoString(segmentInfo)}`); // If there's an init segment associated wi
|
|
|
73019
73032
|
}
|
|
73020
73033
|
}
|
|
73021
73034
|
|
|
73035
|
+
/** @import Player from 'video.js/dist/types/player' */
|
|
73036
|
+
|
|
73022
73037
|
/* eslint max-statements: ["error", 25]*/
|
|
73023
73038
|
|
|
73024
73039
|
/**
|
|
@@ -73037,6 +73052,19 @@ ${segmentInfoString(segmentInfo)}`); // If there's an init segment associated wi
|
|
|
73037
73052
|
* @see https://github.com/SRGSSR/pillarbox-documentation/blob/main/Specifications/monitoring.md
|
|
73038
73053
|
*/
|
|
73039
73054
|
class PillarboxMonitoring {
|
|
73055
|
+
/**
|
|
73056
|
+
* Creates an instance of PillarboxMonitoring.
|
|
73057
|
+
*
|
|
73058
|
+
* @constructor
|
|
73059
|
+
* @param {Player} player The player instance to be monitored
|
|
73060
|
+
* @param {PillarboxMonitoringOptions} [options={}] Configuration options for the monitoring
|
|
73061
|
+
* @param {string} [options.playerName='none'] The name of the player
|
|
73062
|
+
* @param {string} [options.playerVersion='none'] The version of the player
|
|
73063
|
+
* @param {string} [options.platform='Web'] The platform on which the player is running
|
|
73064
|
+
* @param {number} [options.schemaVersion=1] The version of the schema used for monitoring
|
|
73065
|
+
* @param {number} [options.heartbeatInterval=30000] The interval in milliseconds for sending heartbeat signals
|
|
73066
|
+
* @param {string} [options.beaconUrl='https://monitoring.pillarbox.ch/api/events'] The URL for the monitoring beacon
|
|
73067
|
+
*/
|
|
73040
73068
|
constructor(player, {
|
|
73041
73069
|
playerName = 'none',
|
|
73042
73070
|
playerVersion = 'none',
|
|
@@ -73859,6 +73887,19 @@ ${segmentInfoString(segmentInfo)}`); // If there's an init segment associated wi
|
|
|
73859
73887
|
}
|
|
73860
73888
|
}
|
|
73861
73889
|
|
|
73890
|
+
/**
|
|
73891
|
+
* @typedef {import('./typedef').Channel} Channel
|
|
73892
|
+
* @typedef {import('./typedef').Chapter} Chapter
|
|
73893
|
+
* @typedef {import('./typedef').Episode} Episode
|
|
73894
|
+
* @typedef {import('./typedef').Resource} Resource
|
|
73895
|
+
* @typedef {import('./typedef').Segment} Segment
|
|
73896
|
+
* @typedef {import('./typedef').Show} Show
|
|
73897
|
+
* @typedef {import('./typedef').Subtitle} Subtitle
|
|
73898
|
+
* @typedef {import('./typedef').TimeInterval} TimeInterval
|
|
73899
|
+
* @typedef {import('./typedef').Topic} Topic
|
|
73900
|
+
* @typedef {import('./typedef').MainResource} MainResource
|
|
73901
|
+
*/
|
|
73902
|
+
|
|
73862
73903
|
/**
|
|
73863
73904
|
* Represents the composition of media content.
|
|
73864
73905
|
*
|
|
@@ -74057,6 +74098,7 @@ ${segmentInfoString(segmentInfo)}`); // If there's an init segment associated wi
|
|
|
74057
74098
|
imageCopyright: this.getMainChapter().imageCopyright,
|
|
74058
74099
|
intervals: this.getMainTimeIntervals(),
|
|
74059
74100
|
live: resource.live,
|
|
74101
|
+
mediaContainer: resource.mediaContainer,
|
|
74060
74102
|
mediaType: this.getMainChapter().mediaType,
|
|
74061
74103
|
mimeType: resource.mimeType,
|
|
74062
74104
|
presentation: resource.presentation,
|
|
@@ -74147,19 +74189,6 @@ ${segmentInfoString(segmentInfo)}`); // If there's an init segment associated wi
|
|
|
74147
74189
|
}
|
|
74148
74190
|
}
|
|
74149
74191
|
|
|
74150
|
-
/**
|
|
74151
|
-
* @typedef {import('./typedef').Channel} Channel
|
|
74152
|
-
* @typedef {import('./typedef').Chapter} Chapter
|
|
74153
|
-
* @typedef {import('./typedef').Episode} Episode
|
|
74154
|
-
* @typedef {import('./typedef').Resource} Resource
|
|
74155
|
-
* @typedef {import('./typedef').Segment} Segment
|
|
74156
|
-
* @typedef {import('./typedef').Show} Show
|
|
74157
|
-
* @typedef {import('./typedef').Subtitle} Subtitle
|
|
74158
|
-
* @typedef {import('./typedef').TimeInterval} TimeInterval
|
|
74159
|
-
* @typedef {import('./typedef').Topic} Topic
|
|
74160
|
-
* @typedef {import('./typedef').MainResource} MainResource
|
|
74161
|
-
*/
|
|
74162
|
-
|
|
74163
74192
|
const Play$4 = "Wiedergabe";
|
|
74164
74193
|
const Pause$4 = "Pause";
|
|
74165
74194
|
const Replay$4 = "Erneut abspielen";
|
|
@@ -74928,6 +74957,10 @@ ${segmentInfoString(segmentInfo)}`); // If there's an init segment associated wi
|
|
|
74928
74957
|
const _excluded = ["url", "mimeType", "keySystems"],
|
|
74929
74958
|
_excluded2 = ["src"];
|
|
74930
74959
|
|
|
74960
|
+
/** @import Player from 'video.js/dist/types/player' */
|
|
74961
|
+
/** @import {Chapter, MainResource, Segment, Subtitle, TimeInterval} from '../dataProvider/model/typedef' */
|
|
74962
|
+
/** @import {ComposedSrcMediaData, MainResourceWithKeySystems} from './typedef' */
|
|
74963
|
+
|
|
74931
74964
|
/**
|
|
74932
74965
|
* @class SrgSsr
|
|
74933
74966
|
*/
|
|
@@ -74935,8 +74968,8 @@ ${segmentInfoString(segmentInfo)}`); // If there's an init segment associated wi
|
|
|
74935
74968
|
/**
|
|
74936
74969
|
* Adds blocked segments to the player.
|
|
74937
74970
|
*
|
|
74938
|
-
* @param {
|
|
74939
|
-
* @param {Array<
|
|
74971
|
+
* @param {Player} player
|
|
74972
|
+
* @param {Array<Segment>} [segments=[]]
|
|
74940
74973
|
*/
|
|
74941
74974
|
static addBlockedSegments(player, segments = []) {
|
|
74942
74975
|
const trackId = 'srgssr-blocked-segments';
|
|
@@ -74958,8 +74991,8 @@ ${segmentInfoString(segmentInfo)}`); // If there's an init segment associated wi
|
|
|
74958
74991
|
/**
|
|
74959
74992
|
* Adds remote text tracks from an array of subtitles.
|
|
74960
74993
|
*
|
|
74961
|
-
* @param {
|
|
74962
|
-
* @param {Array<
|
|
74994
|
+
* @param {Player} player
|
|
74995
|
+
* @param {Array<Subtitle>} [subtitles=[]]
|
|
74963
74996
|
*/
|
|
74964
74997
|
static addRemoteTextTracks(player, subtitles = []) {
|
|
74965
74998
|
if (!Array.isArray(subtitles)) return;
|
|
@@ -74983,9 +75016,9 @@ ${segmentInfoString(segmentInfo)}`); // If there's an init segment associated wi
|
|
|
74983
75016
|
*
|
|
74984
75017
|
* @param {TextTrack} textTrack
|
|
74985
75018
|
* @param {
|
|
74986
|
-
*
|
|
74987
|
-
*
|
|
74988
|
-
*
|
|
75019
|
+
* Segment |
|
|
75020
|
+
* Chapter |
|
|
75021
|
+
* TimeInterval
|
|
74989
75022
|
* } data SRG SSR's cue-like representation
|
|
74990
75023
|
*/
|
|
74991
75024
|
static addTextTrackCue(textTrack, data) {
|
|
@@ -74997,8 +75030,8 @@ ${segmentInfoString(segmentInfo)}`); // If there's an init segment associated wi
|
|
|
74997
75030
|
/**
|
|
74998
75031
|
* Add multiple text tracks to the player.
|
|
74999
75032
|
*
|
|
75000
|
-
* @param {
|
|
75001
|
-
* @param {
|
|
75033
|
+
* @param {Player} player
|
|
75034
|
+
* @param {ComposedSrcMediaData} srcMediaObj
|
|
75002
75035
|
*/
|
|
75003
75036
|
static addTextTracks(player, {
|
|
75004
75037
|
mediaData
|
|
@@ -75012,9 +75045,9 @@ ${segmentInfoString(segmentInfo)}`); // If there's an init segment associated wi
|
|
|
75012
75045
|
/**
|
|
75013
75046
|
* Adds chapters to the player.
|
|
75014
75047
|
*
|
|
75015
|
-
* @param {
|
|
75048
|
+
* @param {Player} player
|
|
75016
75049
|
* @param {string} chapterUrn The URN of the main chapter.
|
|
75017
|
-
* @param {Array.<
|
|
75050
|
+
* @param {Array.<Chapter>} [chapters=[]]
|
|
75018
75051
|
*/
|
|
75019
75052
|
static addChapters(player, chapterUrn, chapters = []) {
|
|
75020
75053
|
const trackId = 'srgssr-chapters';
|
|
@@ -75035,8 +75068,8 @@ ${segmentInfoString(segmentInfo)}`); // If there's an init segment associated wi
|
|
|
75035
75068
|
/**
|
|
75036
75069
|
* Adds intervals to the player.
|
|
75037
75070
|
*
|
|
75038
|
-
* @param {
|
|
75039
|
-
* @param {Array.<
|
|
75071
|
+
* @param {Player} player
|
|
75072
|
+
* @param {Array.<TimeInterval>} [intervals=[]]
|
|
75040
75073
|
*/
|
|
75041
75074
|
static addIntervals(player, intervals = []) {
|
|
75042
75075
|
const trackId = 'srgssr-intervals';
|
|
@@ -75057,8 +75090,8 @@ ${segmentInfoString(segmentInfo)}`); // If there's an init segment associated wi
|
|
|
75057
75090
|
* Set a blocking reason according to the block reason returned
|
|
75058
75091
|
* by mediaData.
|
|
75059
75092
|
*
|
|
75060
|
-
* @param {
|
|
75061
|
-
* @param {
|
|
75093
|
+
* @param {Player} player
|
|
75094
|
+
* @param {ComposedSrcMediaData} srcMediaObj
|
|
75062
75095
|
*
|
|
75063
75096
|
* @returns {undefined|Boolean}
|
|
75064
75097
|
*/
|
|
@@ -75081,9 +75114,9 @@ ${segmentInfoString(segmentInfo)}`); // If there's an init segment associated wi
|
|
|
75081
75114
|
* if at least one of them has tokenType
|
|
75082
75115
|
* set to Akamai.
|
|
75083
75116
|
*
|
|
75084
|
-
* @param {Array.<
|
|
75117
|
+
* @param {Array.<MainResourceWithKeySystems>} resources
|
|
75085
75118
|
*
|
|
75086
|
-
* @returns {Promise<Array.<
|
|
75119
|
+
* @returns {Promise<Array.<MainResourceWithKeySystems>>}
|
|
75087
75120
|
*/
|
|
75088
75121
|
static composeAkamaiResources(resources = []) {
|
|
75089
75122
|
return _asyncToGenerator(function* () {
|
|
@@ -75100,9 +75133,9 @@ ${segmentInfoString(segmentInfo)}`); // If there's an init segment associated wi
|
|
|
75100
75133
|
* Add the keySystems property to all resources
|
|
75101
75134
|
* if at least one of them has DRM.
|
|
75102
75135
|
*
|
|
75103
|
-
* @param {Array.<
|
|
75136
|
+
* @param {Array.<MainResource>} resources
|
|
75104
75137
|
*
|
|
75105
|
-
* @returns {Array.<
|
|
75138
|
+
* @returns {Array.<MainResourceWithKeySystems>}
|
|
75106
75139
|
*/
|
|
75107
75140
|
static composeKeySystemsResources(resources = []) {
|
|
75108
75141
|
if (!Drm.hasDrm(resources)) return resources;
|
|
@@ -75116,7 +75149,7 @@ ${segmentInfoString(segmentInfo)}`); // If there's an init segment associated wi
|
|
|
75116
75149
|
*
|
|
75117
75150
|
* @param {MediaComposition} mediaComposition
|
|
75118
75151
|
*
|
|
75119
|
-
* @returns {Promise<Array.<
|
|
75152
|
+
* @returns {Promise<Array.<MainResourceWithKeySystems>>}
|
|
75120
75153
|
*/
|
|
75121
75154
|
static composeMainResources(mediaComposition) {
|
|
75122
75155
|
return SrgSsr.composeAkamaiResources(SrgSsr.composeKeySystemsResources(SrgSsr.filterIncompatibleResources(mediaComposition.getMainResources())));
|
|
@@ -75129,9 +75162,9 @@ ${segmentInfoString(segmentInfo)}`); // If there's an init segment associated wi
|
|
|
75129
75162
|
* @param {any} srcObj
|
|
75130
75163
|
* @param {any} srcObj.mediaData overrides or adds metadata to the composed mediaData.
|
|
75131
75164
|
* @param {boolean} srcObj.disableTrackers
|
|
75132
|
-
* @param {
|
|
75165
|
+
* @param {MainResourceWithKeySystems} resource
|
|
75133
75166
|
*
|
|
75134
|
-
* @returns {
|
|
75167
|
+
* @returns {ComposedSrcMediaData}
|
|
75135
75168
|
*/
|
|
75136
75169
|
static composeSrcMediaData({
|
|
75137
75170
|
mediaData: srcMediaData,
|
|
@@ -75156,7 +75189,7 @@ ${segmentInfoString(segmentInfo)}`); // If there's an init segment associated wi
|
|
|
75156
75189
|
/**
|
|
75157
75190
|
* Create a new metadata text track.
|
|
75158
75191
|
*
|
|
75159
|
-
* @param {
|
|
75192
|
+
* @param {Player} player
|
|
75160
75193
|
* @param {String} trackId Text track unique ID
|
|
75161
75194
|
*
|
|
75162
75195
|
* @returns {Promise<TextTrack>}
|
|
@@ -75178,7 +75211,7 @@ ${segmentInfoString(segmentInfo)}`); // If there's an init segment associated wi
|
|
|
75178
75211
|
/**
|
|
75179
75212
|
* Proxy SRG SSR chapters and intervals cuechange events at player level.
|
|
75180
75213
|
*
|
|
75181
|
-
* @param {
|
|
75214
|
+
* @param {Player} player
|
|
75182
75215
|
*/
|
|
75183
75216
|
static cuechangeEventProxy(player) {
|
|
75184
75217
|
player.textTracks().on('addtrack', ({
|
|
@@ -75199,7 +75232,7 @@ ${segmentInfoString(segmentInfo)}`); // If there's an init segment associated wi
|
|
|
75199
75232
|
/**
|
|
75200
75233
|
* SRG SSR data provider singleton.
|
|
75201
75234
|
*
|
|
75202
|
-
* @param {
|
|
75235
|
+
* @param {Player} player
|
|
75203
75236
|
*
|
|
75204
75237
|
* @returns {DataProvider}
|
|
75205
75238
|
*/
|
|
@@ -75223,7 +75256,7 @@ ${segmentInfoString(segmentInfo)}`); // If there's an init segment associated wi
|
|
|
75223
75256
|
/**
|
|
75224
75257
|
* Set an error if something goes wrong with the data provider.
|
|
75225
75258
|
*
|
|
75226
|
-
* @param {
|
|
75259
|
+
* @param {Player} player
|
|
75227
75260
|
* @param {Object} error
|
|
75228
75261
|
*
|
|
75229
75262
|
* @returns {undefined|true}
|
|
@@ -75248,7 +75281,7 @@ ${segmentInfoString(segmentInfo)}`); // If there's an init segment associated wi
|
|
|
75248
75281
|
/**
|
|
75249
75282
|
* Set player error.
|
|
75250
75283
|
*
|
|
75251
|
-
* @param {
|
|
75284
|
+
* @param {Player} player
|
|
75252
75285
|
* @param {Object} error
|
|
75253
75286
|
*/
|
|
75254
75287
|
static error(player, {
|
|
@@ -75267,9 +75300,9 @@ ${segmentInfoString(segmentInfo)}`); // If there's an init segment associated wi
|
|
|
75267
75300
|
/**
|
|
75268
75301
|
* Filter out incompatible resources such as `RTMP` and `HDS`.
|
|
75269
75302
|
*
|
|
75270
|
-
* @param {Array.<
|
|
75303
|
+
* @param {Array.<MainResource>} resources Resources to filter
|
|
75271
75304
|
*
|
|
75272
|
-
* @returns {Array.<
|
|
75305
|
+
* @returns {Array.<MainResource>} The filtered resources
|
|
75273
75306
|
*/
|
|
75274
75307
|
static filterIncompatibleResources(resources = []) {
|
|
75275
75308
|
return resources.filter(resource => !['RTMP', 'HDS'].includes(resource.streaming));
|
|
@@ -75278,7 +75311,7 @@ ${segmentInfoString(segmentInfo)}`); // If there's an init segment associated wi
|
|
|
75278
75311
|
/**
|
|
75279
75312
|
* Get the current blocked segment from the player.
|
|
75280
75313
|
*
|
|
75281
|
-
* @param {
|
|
75314
|
+
* @param {Player} player
|
|
75282
75315
|
*
|
|
75283
75316
|
* @returns {VTTCue|undefined} The blocked segment cue object, or undefined
|
|
75284
75317
|
*/
|
|
@@ -75295,7 +75328,7 @@ ${segmentInfoString(segmentInfo)}`); // If there's an init segment associated wi
|
|
|
75295
75328
|
/**
|
|
75296
75329
|
* Get the VTT cue of a blocked segment.
|
|
75297
75330
|
*
|
|
75298
|
-
* @param {
|
|
75331
|
+
* @param {Player} player
|
|
75299
75332
|
* @param {Number} currentTime
|
|
75300
75333
|
*
|
|
75301
75334
|
* @returns {VTTCue|undefined} The VTT cue of a blocked segment, or undefined
|
|
@@ -75325,9 +75358,9 @@ ${segmentInfoString(segmentInfo)}`); // If there's an init segment associated wi
|
|
|
75325
75358
|
/**
|
|
75326
75359
|
* Get the mediaData most likely to be compatible depending on the browser.
|
|
75327
75360
|
*
|
|
75328
|
-
* @param {Array.<
|
|
75361
|
+
* @param {Array.<MainResourceWithKeySystems>} resources
|
|
75329
75362
|
*
|
|
75330
|
-
* @returns {
|
|
75363
|
+
* @returns {MainResourceWithKeySystems} By default, the first entry is used if none is compatible.
|
|
75331
75364
|
*/
|
|
75332
75365
|
static getMediaData(resources = []) {
|
|
75333
75366
|
if (AkamaiTokenService.hasToken(resources)) return resources[0];
|
|
@@ -75341,10 +75374,10 @@ ${segmentInfoString(segmentInfo)}`); // If there's an init segment associated wi
|
|
|
75341
75374
|
/**
|
|
75342
75375
|
* Get the source media object.
|
|
75343
75376
|
*
|
|
75344
|
-
* @param {
|
|
75377
|
+
* @param {Player} player
|
|
75345
75378
|
* @param {any} srcObj
|
|
75346
75379
|
*
|
|
75347
|
-
* @returns {Promise<
|
|
75380
|
+
* @returns {Promise<ComposedSrcMediaData>} - The composed source media data.
|
|
75348
75381
|
*/
|
|
75349
75382
|
static getSrcMediaObj(player, srcObj) {
|
|
75350
75383
|
return _asyncToGenerator(function* () {
|
|
@@ -75376,7 +75409,7 @@ ${segmentInfoString(segmentInfo)}`); // If there's an init segment associated wi
|
|
|
75376
75409
|
* _Note_: This function should disappear as soon as this behavior is
|
|
75377
75410
|
* supported on the packaging side.
|
|
75378
75411
|
*
|
|
75379
|
-
* @param {
|
|
75412
|
+
* @param {Player} player
|
|
75380
75413
|
* @param {number} currentTime
|
|
75381
75414
|
*
|
|
75382
75415
|
* @returns {number}
|
|
@@ -75408,7 +75441,7 @@ ${segmentInfoString(segmentInfo)}`); // If there's an init segment associated wi
|
|
|
75408
75441
|
* _Note_: This function should disappear as soon as this behavior is
|
|
75409
75442
|
* supported on the packaging side.
|
|
75410
75443
|
*
|
|
75411
|
-
* @param {
|
|
75444
|
+
* @param {Player} player
|
|
75412
75445
|
* @param {number} currentTime
|
|
75413
75446
|
*
|
|
75414
75447
|
* @returns {number}
|
|
@@ -75430,7 +75463,7 @@ ${segmentInfoString(segmentInfo)}`); // If there's an init segment associated wi
|
|
|
75430
75463
|
* - handle blocking reasons
|
|
75431
75464
|
* - add remote subtitles
|
|
75432
75465
|
*
|
|
75433
|
-
* @param {
|
|
75466
|
+
* @param {Player} player
|
|
75434
75467
|
* @param {any} srcObj
|
|
75435
75468
|
* @param {function} next
|
|
75436
75469
|
*
|
|
@@ -75456,7 +75489,7 @@ ${segmentInfoString(segmentInfo)}`); // If there's an init segment associated wi
|
|
|
75456
75489
|
/**
|
|
75457
75490
|
* SRG SSR analytics singleton.
|
|
75458
75491
|
*
|
|
75459
|
-
* @param {
|
|
75492
|
+
* @param {Player} player
|
|
75460
75493
|
*/
|
|
75461
75494
|
static srgAnalytics(player) {
|
|
75462
75495
|
if (player.options().trackers.srgAnalytics === false) return;
|
|
@@ -75477,7 +75510,7 @@ ${segmentInfoString(segmentInfo)}`); // If there's an init segment associated wi
|
|
|
75477
75510
|
/**
|
|
75478
75511
|
* PillarboxMonitoring monitoring singleton.
|
|
75479
75512
|
*
|
|
75480
|
-
* @param {
|
|
75513
|
+
* @param {Player} player
|
|
75481
75514
|
*
|
|
75482
75515
|
* @returns {PillarboxMonitoring} instance of PillarboxMonitoring
|
|
75483
75516
|
*/
|
|
@@ -75501,8 +75534,8 @@ ${segmentInfoString(segmentInfo)}`); // If there's an init segment associated wi
|
|
|
75501
75534
|
/**
|
|
75502
75535
|
* Update player's poster.
|
|
75503
75536
|
*
|
|
75504
|
-
* @param {
|
|
75505
|
-
* @param {
|
|
75537
|
+
* @param {Player} player
|
|
75538
|
+
* @param {ComposedSrcMediaData} srcMediaObj
|
|
75506
75539
|
* @param {Image} imageService
|
|
75507
75540
|
*/
|
|
75508
75541
|
static updatePoster(player, srcMediaObj, imageService = Image) {
|
|
@@ -75514,8 +75547,8 @@ ${segmentInfoString(segmentInfo)}`); // If there's an init segment associated wi
|
|
|
75514
75547
|
/**
|
|
75515
75548
|
* Update player titleBar with title and description.
|
|
75516
75549
|
*
|
|
75517
|
-
* @param {
|
|
75518
|
-
* @param {
|
|
75550
|
+
* @param {Player} player
|
|
75551
|
+
* @param {ComposedSrcMediaData} srcMediaObj
|
|
75519
75552
|
*/
|
|
75520
75553
|
static updateTitleBar(player, srcMediaObj) {
|
|
75521
75554
|
if (!player.titleBar) return;
|
|
@@ -75528,7 +75561,7 @@ ${segmentInfoString(segmentInfo)}`); // If there's an init segment associated wi
|
|
|
75528
75561
|
/**
|
|
75529
75562
|
* Middleware to resolve SRG SSR URNs into playable media.
|
|
75530
75563
|
*
|
|
75531
|
-
* @param {
|
|
75564
|
+
* @param {Player} player
|
|
75532
75565
|
*
|
|
75533
75566
|
* @returns {Object}
|
|
75534
75567
|
*/
|