@srgssr/pillarbox-web 1.16.0 → 1.18.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 +143 -111
- package/dist/pillarbox.cjs.js.map +1 -1
- package/dist/pillarbox.es.js +144 -112
- package/dist/pillarbox.es.js.map +1 -1
- package/dist/pillarbox.min.css +1 -1
- package/dist/pillarbox.min.css.map +1 -1
- package/dist/pillarbox.umd.js +143 -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/scss/components/_layout.scss +9 -0
- 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.es.js
CHANGED
|
@@ -107,11 +107,16 @@ function _objectWithoutProperties(source, excluded) {
|
|
|
107
107
|
return target;
|
|
108
108
|
}
|
|
109
109
|
|
|
110
|
-
const version = "1.
|
|
110
|
+
const version = "1.17.0";
|
|
111
|
+
|
|
112
|
+
/** @import VJSPlayer from 'video.js/dist/types/player' */
|
|
113
|
+
/** @import AudioTrack from 'video.js/dist/types/tracks/audio-track' */
|
|
114
|
+
/** @import TextTrack from 'video.js/dist/types/tracks/text-track' */
|
|
115
|
+
/** @import {TrackSelector} from './typedef' */
|
|
111
116
|
|
|
112
117
|
/**
|
|
113
118
|
* @ignore
|
|
114
|
-
* @type {typeof
|
|
119
|
+
* @type {typeof VJSPlayer}
|
|
115
120
|
*/
|
|
116
121
|
const vjsPlayer = videojs.getComponent('player');
|
|
117
122
|
|
|
@@ -146,7 +151,7 @@ class Player extends vjsPlayer {
|
|
|
146
151
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/AudioTrack/kind
|
|
147
152
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/AudioTrack/language
|
|
148
153
|
*
|
|
149
|
-
* @param {
|
|
154
|
+
* @param {TrackSelector} [trackSelector]
|
|
150
155
|
*
|
|
151
156
|
* @example
|
|
152
157
|
* // Get the current audio track
|
|
@@ -160,7 +165,7 @@ class Player extends vjsPlayer {
|
|
|
160
165
|
* // Activate first audio track found corresponding to language
|
|
161
166
|
* player.audioTrack({language:'fr'});
|
|
162
167
|
*
|
|
163
|
-
* @return {
|
|
168
|
+
* @return {AudioTrack | undefined} The
|
|
164
169
|
* currently enabled audio track. See {@link https://docs.videojs.com/audiotrack}.
|
|
165
170
|
*/
|
|
166
171
|
audioTrack(trackSelector) {
|
|
@@ -270,7 +275,7 @@ class Player extends vjsPlayer {
|
|
|
270
275
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/TextTrack/kind
|
|
271
276
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/textTrack/language
|
|
272
277
|
*
|
|
273
|
-
* @param {
|
|
278
|
+
* @param {TrackSelector} [trackSelector]
|
|
274
279
|
*
|
|
275
280
|
* @example
|
|
276
281
|
* // Get the current text track
|
|
@@ -289,7 +294,7 @@ class Player extends vjsPlayer {
|
|
|
289
294
|
* // Activate first text track found corresponding to language
|
|
290
295
|
* player.textTrack({language:'fr'});
|
|
291
296
|
*
|
|
292
|
-
* @return {
|
|
297
|
+
* @return {TextTrack | undefined} The
|
|
293
298
|
* currently enabled text track. See {@link https://docs.videojs.com/texttrack}.
|
|
294
299
|
*/
|
|
295
300
|
textTrack(trackSelector) {
|
|
@@ -408,10 +413,11 @@ pillarbox.options.responsive = true;
|
|
|
408
413
|
*/
|
|
409
414
|
pillarbox.options.trackers = {};
|
|
410
415
|
|
|
416
|
+
/** @import MediaComposition from '../model/MediaComposition.js' */
|
|
417
|
+
|
|
411
418
|
/**
|
|
412
419
|
* Represents a data provider for constructing URLs and handling requests.
|
|
413
420
|
* @class
|
|
414
|
-
* @ignore
|
|
415
421
|
*/
|
|
416
422
|
class DataProvider {
|
|
417
423
|
/**
|
|
@@ -439,7 +445,7 @@ class DataProvider {
|
|
|
439
445
|
*
|
|
440
446
|
* @param {Function} urlHandler A function that constructs the URL
|
|
441
447
|
*
|
|
442
|
-
* @returns {Promise<
|
|
448
|
+
* @returns {Promise<MediaComposition>} A promise with the fetched data
|
|
443
449
|
*/
|
|
444
450
|
handleRequest(urlHandler) {
|
|
445
451
|
var _this = this;
|
|
@@ -451,7 +457,7 @@ class DataProvider {
|
|
|
451
457
|
throw response;
|
|
452
458
|
}
|
|
453
459
|
|
|
454
|
-
/** @type {
|
|
460
|
+
/** @type {MediaComposition} */
|
|
455
461
|
const data = yield response.json();
|
|
456
462
|
return data;
|
|
457
463
|
});
|
|
@@ -840,67 +846,65 @@ const TIME_UPDATE = 'timeupdate';
|
|
|
840
846
|
*/
|
|
841
847
|
const WAITING = 'waiting';
|
|
842
848
|
|
|
849
|
+
/** @import Player from 'video.js/dist/types/player' */
|
|
850
|
+
|
|
843
851
|
/* eslint max-lines-per-function: ["error", 200] */
|
|
844
852
|
/* eslint max-statements: ["error", 20]*/
|
|
845
853
|
/* eslint complexity: ["error", 10]*/
|
|
854
|
+
|
|
846
855
|
/**
|
|
847
|
-
* SRG analytics
|
|
848
|
-
* @class SRGAnalytics
|
|
849
|
-
* @ignore
|
|
856
|
+
* The SRG analytics class tracks media playback according to the standard defined by SRG SSR.
|
|
850
857
|
*
|
|
851
|
-
*
|
|
852
|
-
* JS script : https://colibri-js.akamaized.net/penguin/tc_SRGGD_11.js
|
|
858
|
+
* @class SRGAnalytics
|
|
853
859
|
*
|
|
854
860
|
* ### Official documentation
|
|
855
|
-
* Variables list
|
|
856
|
-
* @see https://confluence.srg.beecollaboration.com/display/INTFORSCHUNG/Datalayer+for+media+players
|
|
857
861
|
*
|
|
858
|
-
*
|
|
859
|
-
* @
|
|
862
|
+
* - [New variable list]{@link https://srgssr-ch.atlassian.net/wiki/spaces/INTFORSCHUNG/pages/1009353309/Labels+check+for+migration+of+integration+layer+in+SAM}
|
|
863
|
+
* - [Variables list]{@link https://srgssr-ch.atlassian.net/wiki/spaces/INTFORSCHUNG/pages/795904478/Datalayer+for+media+players}
|
|
864
|
+
* - [Standard event sequences]{@link https://srgssr-ch.atlassian.net/wiki/spaces/INTFORSCHUNG/pages/795904171/standard+streaming+events+sequence+of+events+for+media+player+actions}
|
|
865
|
+
* - [Review of Standard Media Actions]{@link https://srgssr-ch.atlassian.net/wiki/spaces/INTFORSCHUNG/pages/795902249/Implementation+Concept+-+draft}
|
|
866
|
+
* - [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}
|
|
860
867
|
*
|
|
861
|
-
*
|
|
862
|
-
* @see https://confluence.srg.beecollaboration.com/display/INTFORSCHUNG/Implementation+Concept+-+draft
|
|
868
|
+
* ### Script URL
|
|
863
869
|
*
|
|
864
|
-
*
|
|
865
|
-
* @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
|
|
870
|
+
* JS script : https://colibri-js.akamaized.net/penguin/tc_SRGGD_11.js
|
|
866
871
|
*
|
|
867
872
|
* ### Variables list
|
|
868
|
-
* - 'event_id', // init | play | stop | pos | pause | seek | uptime | eof
|
|
869
|
-
* - 'event_timestamp', // Seems to be generated automatically from the documentation, but the TP overrides it
|
|
870
|
-
* - 'event_name', // NA TP seems to not sending this variable
|
|
871
|
-
* - 'event_source', // NA TP seems to not sending this variable
|
|
872
|
-
* - 'event_name', // NA TP seems to not sending this variable
|
|
873
|
-
* - 'event_value', // NA TP seems to not sending this variable
|
|
874
|
-
* - 'navigation_environment', // prod | preprod
|
|
875
|
-
* - 'media_subtitles_on', // string true | false
|
|
876
|
-
* - 'media_timeshift', // need better description
|
|
877
|
-
* - 'media_quality', // SD | HD ?
|
|
878
|
-
* - 'media_bandwidth', // NA for the web, 64000
|
|
879
|
-
* - 'media_volume', // from 0 to 100
|
|
880
|
-
* - 'media_embedding_url', //
|
|
881
|
-
* - 'media_player_name', // videojs | letterbox-web ?
|
|
882
|
-
* - 'media_chromecast_selected', // boolean true | false
|
|
883
|
-
* - 'media_player_version', // player's version
|
|
884
|
-
* - 'media_player_display', // is the player mode, on the TP : inline, embed etc..
|
|
885
|
-
* - 'media_audio_track', // NA
|
|
886
|
-
* - 'media_position_real', // NA
|
|
887
|
-
* - 'media_time_spent', // NA
|
|
888
|
-
* - 'device_id', // NA
|
|
889
|
-
* - 'user_id_log_in', // NA only RTS has log in today
|
|
890
|
-
* - 'media_thumbnail', // Not required by the spec but sended by the TP
|
|
891
|
-
* - 'media_bu_distributer', // Not required by the spec but sended by the TP
|
|
892
873
|
*
|
|
874
|
+
* - event_id: init | play | stop | pos | pause | seek | uptime | eof
|
|
875
|
+
* - event_timestamp: Seems to be generated automatically from the documentation, but the TP overrides it
|
|
876
|
+
* - event_name: NA TP seems to not sending this variable
|
|
877
|
+
* - event_source: NA TP seems to not sending this variable
|
|
878
|
+
* - event_name: NA TP seems to not sending this variable
|
|
879
|
+
* - event_value: NA TP seems to not sending this variable
|
|
880
|
+
* - navigation_environment: prod | preprod
|
|
881
|
+
* - media_subtitles_on: string true | false
|
|
882
|
+
* - media_timeshift: need better description
|
|
883
|
+
* - media_quality: SD | HD ?
|
|
884
|
+
* - media_bandwidth: NA for the web, 64000
|
|
885
|
+
* - media_volume: from 0 to 100
|
|
886
|
+
* - media_embedding_url:
|
|
887
|
+
* - media_player_name: videojs | letterbox-web ?
|
|
888
|
+
* - media_chromecast_selected: boolean true | false
|
|
889
|
+
* - media_player_version: player's version
|
|
890
|
+
* - media_player_display: is the player mode, on the TP : inline, embed etc..
|
|
891
|
+
* - media_audio_track: NA
|
|
892
|
+
* - media_position_real: NA
|
|
893
|
+
* - media_time_spent: NA
|
|
894
|
+
* - device_id: NA
|
|
895
|
+
* - user_id_log_in: NA only RTS has log in today
|
|
896
|
+
* - media_thumbnail: Not required by the spec but sended by the TP
|
|
897
|
+
* - media_bu_distributer: Not required by the spec but sended by the TP
|
|
893
898
|
*
|
|
894
899
|
* ### Sequence stories
|
|
895
900
|
*
|
|
896
|
-
*
|
|
901
|
+
* #### Story 1 (AoD/VOD-basics): A VoD is played. The user does not interact with the player. The VoD plays to its end.
|
|
897
902
|
*
|
|
898
903
|
* Hints:
|
|
899
904
|
* - Media sessions always start with PLAY. They end with STOP or EOF (or with PAUSE or last POS)
|
|
900
905
|
* - POS is sent ever 30s
|
|
901
906
|
*
|
|
902
|
-
*
|
|
903
|
-
* __Story 2 (livestream-basics A)__: A Livestream is played. The user does not interact with the player. After 61 seconds, playback is paused.
|
|
907
|
+
* #### Story 2 (livestream-basics A): A Livestream is played. The user does not interact with the player. After 61 seconds, playback is paused.
|
|
904
908
|
*
|
|
905
909
|
* Hints:
|
|
906
910
|
* - Media sessions always start with PLAY. They end with STOP (or, worse for data quailty, with PAUSE or last POS/UPTIME)
|
|
@@ -908,14 +912,12 @@ const WAITING = 'waiting';
|
|
|
908
912
|
* - POS is sent ever 30s, UPTIME every 60s with inital UPTIME after 30s.
|
|
909
913
|
* - This is the interval: 30s: POS + UPTIME; 60s: POS; 90s: POS + UPTIME; ...
|
|
910
914
|
*
|
|
911
|
-
*
|
|
912
|
-
* __Story 3 (Seeking a VoD/AoD)__: A VoD is played. User seeks in the VoD/AoD.
|
|
915
|
+
* #### Story 3 (Seeking a VoD/AoD): A VoD is played. User seeks in the VoD/AoD.
|
|
913
916
|
*
|
|
914
917
|
* Hints:
|
|
915
918
|
* - 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.
|
|
916
919
|
*
|
|
917
|
-
*
|
|
918
|
-
* __Story 4 (Seeking a livestream)__: A Livestream is played. User goes back in the livestream.
|
|
920
|
+
* #### Story 4 (Seeking a livestream): A Livestream is played. User goes back in the livestream.
|
|
919
921
|
*
|
|
920
922
|
* Hints:
|
|
921
923
|
* - 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.
|
|
@@ -924,6 +926,17 @@ const WAITING = 'waiting';
|
|
|
924
926
|
* 2. The value of media_position is '1'.
|
|
925
927
|
*/
|
|
926
928
|
class SRGAnalytics {
|
|
929
|
+
/**
|
|
930
|
+
* Creates an instance of SRGAnalytics.
|
|
931
|
+
*
|
|
932
|
+
* @constructor
|
|
933
|
+
* @param {Player} player The player instance
|
|
934
|
+
* @param {SRGAnalyticsOptions} [options={}] Configuration options
|
|
935
|
+
* @param {boolean} [options.debug=false] Enables debug mode if set to true
|
|
936
|
+
* @param {string} [options.environment='prod'] The environment in which the data is sent
|
|
937
|
+
* @param {string} [options.playerVersion='none'] The version of the player
|
|
938
|
+
* @param {string} [options.tagCommanderScriptURL='//colibri-js.akamaized.net/penguin/tc_SRGGD_11.js'] The URL for the Tag Commander script
|
|
939
|
+
*/
|
|
927
940
|
constructor(player, {
|
|
928
941
|
debug = false,
|
|
929
942
|
environment = 'prod',
|
|
@@ -1651,6 +1664,8 @@ class SRGAnalytics {
|
|
|
1651
1664
|
}
|
|
1652
1665
|
}
|
|
1653
1666
|
|
|
1667
|
+
/** @import Player from 'video.js/dist/types/player' */
|
|
1668
|
+
|
|
1654
1669
|
/* eslint max-statements: ["error", 25]*/
|
|
1655
1670
|
|
|
1656
1671
|
/**
|
|
@@ -1669,6 +1684,19 @@ class SRGAnalytics {
|
|
|
1669
1684
|
* @see https://github.com/SRGSSR/pillarbox-documentation/blob/main/Specifications/monitoring.md
|
|
1670
1685
|
*/
|
|
1671
1686
|
class PillarboxMonitoring {
|
|
1687
|
+
/**
|
|
1688
|
+
* Creates an instance of PillarboxMonitoring.
|
|
1689
|
+
*
|
|
1690
|
+
* @constructor
|
|
1691
|
+
* @param {Player} player The player instance to be monitored
|
|
1692
|
+
* @param {PillarboxMonitoringOptions} [options={}] Configuration options for the monitoring
|
|
1693
|
+
* @param {string} [options.playerName='none'] The name of the player
|
|
1694
|
+
* @param {string} [options.playerVersion='none'] The version of the player
|
|
1695
|
+
* @param {string} [options.platform='Web'] The platform on which the player is running
|
|
1696
|
+
* @param {number} [options.schemaVersion=1] The version of the schema used for monitoring
|
|
1697
|
+
* @param {number} [options.heartbeatInterval=30000] The interval in milliseconds for sending heartbeat signals
|
|
1698
|
+
* @param {string} [options.beaconUrl='https://monitoring.pillarbox.ch/api/events'] The URL for the monitoring beacon
|
|
1699
|
+
*/
|
|
1672
1700
|
constructor(player, {
|
|
1673
1701
|
playerName = 'none',
|
|
1674
1702
|
playerVersion = 'none',
|
|
@@ -2491,6 +2519,19 @@ class PillarboxMonitoring {
|
|
|
2491
2519
|
}
|
|
2492
2520
|
}
|
|
2493
2521
|
|
|
2522
|
+
/**
|
|
2523
|
+
* @typedef {import('./typedef').Channel} Channel
|
|
2524
|
+
* @typedef {import('./typedef').Chapter} Chapter
|
|
2525
|
+
* @typedef {import('./typedef').Episode} Episode
|
|
2526
|
+
* @typedef {import('./typedef').Resource} Resource
|
|
2527
|
+
* @typedef {import('./typedef').Segment} Segment
|
|
2528
|
+
* @typedef {import('./typedef').Show} Show
|
|
2529
|
+
* @typedef {import('./typedef').Subtitle} Subtitle
|
|
2530
|
+
* @typedef {import('./typedef').TimeInterval} TimeInterval
|
|
2531
|
+
* @typedef {import('./typedef').Topic} Topic
|
|
2532
|
+
* @typedef {import('./typedef').MainResource} MainResource
|
|
2533
|
+
*/
|
|
2534
|
+
|
|
2494
2535
|
/**
|
|
2495
2536
|
* Represents the composition of media content.
|
|
2496
2537
|
*
|
|
@@ -2779,19 +2820,6 @@ class MediaComposition {
|
|
|
2779
2820
|
}
|
|
2780
2821
|
}
|
|
2781
2822
|
|
|
2782
|
-
/**
|
|
2783
|
-
* @typedef {import('./typedef').Channel} Channel
|
|
2784
|
-
* @typedef {import('./typedef').Chapter} Chapter
|
|
2785
|
-
* @typedef {import('./typedef').Episode} Episode
|
|
2786
|
-
* @typedef {import('./typedef').Resource} Resource
|
|
2787
|
-
* @typedef {import('./typedef').Segment} Segment
|
|
2788
|
-
* @typedef {import('./typedef').Show} Show
|
|
2789
|
-
* @typedef {import('./typedef').Subtitle} Subtitle
|
|
2790
|
-
* @typedef {import('./typedef').TimeInterval} TimeInterval
|
|
2791
|
-
* @typedef {import('./typedef').Topic} Topic
|
|
2792
|
-
* @typedef {import('./typedef').MainResource} MainResource
|
|
2793
|
-
*/
|
|
2794
|
-
|
|
2795
2823
|
const Play$4 = "Wiedergabe";
|
|
2796
2824
|
const Pause$4 = "Pause";
|
|
2797
2825
|
const Replay$4 = "Erneut abspielen";
|
|
@@ -3560,6 +3588,10 @@ pillarbox.addLanguage('rm', _objectSpread2({}, pillarboxLang));
|
|
|
3560
3588
|
const _excluded = ["url", "mimeType", "keySystems"],
|
|
3561
3589
|
_excluded2 = ["src"];
|
|
3562
3590
|
|
|
3591
|
+
/** @import Player from 'video.js/dist/types/player' */
|
|
3592
|
+
/** @import {Chapter, MainResource, Segment, Subtitle, TimeInterval} from '../dataProvider/model/typedef' */
|
|
3593
|
+
/** @import {ComposedSrcMediaData, MainResourceWithKeySystems} from './typedef' */
|
|
3594
|
+
|
|
3563
3595
|
/**
|
|
3564
3596
|
* @class SrgSsr
|
|
3565
3597
|
*/
|
|
@@ -3567,8 +3599,8 @@ class SrgSsr {
|
|
|
3567
3599
|
/**
|
|
3568
3600
|
* Adds blocked segments to the player.
|
|
3569
3601
|
*
|
|
3570
|
-
* @param {
|
|
3571
|
-
* @param {Array<
|
|
3602
|
+
* @param {Player} player
|
|
3603
|
+
* @param {Array<Segment>} [segments=[]]
|
|
3572
3604
|
*/
|
|
3573
3605
|
static addBlockedSegments(player, segments = []) {
|
|
3574
3606
|
const trackId = 'srgssr-blocked-segments';
|
|
@@ -3590,8 +3622,8 @@ class SrgSsr {
|
|
|
3590
3622
|
/**
|
|
3591
3623
|
* Adds remote text tracks from an array of subtitles.
|
|
3592
3624
|
*
|
|
3593
|
-
* @param {
|
|
3594
|
-
* @param {Array<
|
|
3625
|
+
* @param {Player} player
|
|
3626
|
+
* @param {Array<Subtitle>} [subtitles=[]]
|
|
3595
3627
|
*/
|
|
3596
3628
|
static addRemoteTextTracks(player, subtitles = []) {
|
|
3597
3629
|
if (!Array.isArray(subtitles)) return;
|
|
@@ -3615,9 +3647,9 @@ class SrgSsr {
|
|
|
3615
3647
|
*
|
|
3616
3648
|
* @param {TextTrack} textTrack
|
|
3617
3649
|
* @param {
|
|
3618
|
-
*
|
|
3619
|
-
*
|
|
3620
|
-
*
|
|
3650
|
+
* Segment |
|
|
3651
|
+
* Chapter |
|
|
3652
|
+
* TimeInterval
|
|
3621
3653
|
* } data SRG SSR's cue-like representation
|
|
3622
3654
|
*/
|
|
3623
3655
|
static addTextTrackCue(textTrack, data) {
|
|
@@ -3629,8 +3661,8 @@ class SrgSsr {
|
|
|
3629
3661
|
/**
|
|
3630
3662
|
* Add multiple text tracks to the player.
|
|
3631
3663
|
*
|
|
3632
|
-
* @param {
|
|
3633
|
-
* @param {
|
|
3664
|
+
* @param {Player} player
|
|
3665
|
+
* @param {ComposedSrcMediaData} srcMediaObj
|
|
3634
3666
|
*/
|
|
3635
3667
|
static addTextTracks(player, {
|
|
3636
3668
|
mediaData
|
|
@@ -3644,9 +3676,9 @@ class SrgSsr {
|
|
|
3644
3676
|
/**
|
|
3645
3677
|
* Adds chapters to the player.
|
|
3646
3678
|
*
|
|
3647
|
-
* @param {
|
|
3679
|
+
* @param {Player} player
|
|
3648
3680
|
* @param {string} chapterUrn The URN of the main chapter.
|
|
3649
|
-
* @param {Array.<
|
|
3681
|
+
* @param {Array.<Chapter>} [chapters=[]]
|
|
3650
3682
|
*/
|
|
3651
3683
|
static addChapters(player, chapterUrn, chapters = []) {
|
|
3652
3684
|
const trackId = 'srgssr-chapters';
|
|
@@ -3667,8 +3699,8 @@ class SrgSsr {
|
|
|
3667
3699
|
/**
|
|
3668
3700
|
* Adds intervals to the player.
|
|
3669
3701
|
*
|
|
3670
|
-
* @param {
|
|
3671
|
-
* @param {Array.<
|
|
3702
|
+
* @param {Player} player
|
|
3703
|
+
* @param {Array.<TimeInterval>} [intervals=[]]
|
|
3672
3704
|
*/
|
|
3673
3705
|
static addIntervals(player, intervals = []) {
|
|
3674
3706
|
const trackId = 'srgssr-intervals';
|
|
@@ -3689,8 +3721,8 @@ class SrgSsr {
|
|
|
3689
3721
|
* Set a blocking reason according to the block reason returned
|
|
3690
3722
|
* by mediaData.
|
|
3691
3723
|
*
|
|
3692
|
-
* @param {
|
|
3693
|
-
* @param {
|
|
3724
|
+
* @param {Player} player
|
|
3725
|
+
* @param {ComposedSrcMediaData} srcMediaObj
|
|
3694
3726
|
*
|
|
3695
3727
|
* @returns {undefined|Boolean}
|
|
3696
3728
|
*/
|
|
@@ -3713,9 +3745,9 @@ class SrgSsr {
|
|
|
3713
3745
|
* if at least one of them has tokenType
|
|
3714
3746
|
* set to Akamai.
|
|
3715
3747
|
*
|
|
3716
|
-
* @param {Array.<
|
|
3748
|
+
* @param {Array.<MainResourceWithKeySystems>} resources
|
|
3717
3749
|
*
|
|
3718
|
-
* @returns {Promise<Array.<
|
|
3750
|
+
* @returns {Promise<Array.<MainResourceWithKeySystems>>}
|
|
3719
3751
|
*/
|
|
3720
3752
|
static composeAkamaiResources(resources = []) {
|
|
3721
3753
|
return _asyncToGenerator(function* () {
|
|
@@ -3732,9 +3764,9 @@ class SrgSsr {
|
|
|
3732
3764
|
* Add the keySystems property to all resources
|
|
3733
3765
|
* if at least one of them has DRM.
|
|
3734
3766
|
*
|
|
3735
|
-
* @param {Array.<
|
|
3767
|
+
* @param {Array.<MainResource>} resources
|
|
3736
3768
|
*
|
|
3737
|
-
* @returns {Array.<
|
|
3769
|
+
* @returns {Array.<MainResourceWithKeySystems>}
|
|
3738
3770
|
*/
|
|
3739
3771
|
static composeKeySystemsResources(resources = []) {
|
|
3740
3772
|
if (!Drm.hasDrm(resources)) return resources;
|
|
@@ -3748,7 +3780,7 @@ class SrgSsr {
|
|
|
3748
3780
|
*
|
|
3749
3781
|
* @param {MediaComposition} mediaComposition
|
|
3750
3782
|
*
|
|
3751
|
-
* @returns {Promise<Array.<
|
|
3783
|
+
* @returns {Promise<Array.<MainResourceWithKeySystems>>}
|
|
3752
3784
|
*/
|
|
3753
3785
|
static composeMainResources(mediaComposition) {
|
|
3754
3786
|
return SrgSsr.composeAkamaiResources(SrgSsr.composeKeySystemsResources(SrgSsr.filterIncompatibleResources(mediaComposition.getMainResources())));
|
|
@@ -3761,9 +3793,9 @@ class SrgSsr {
|
|
|
3761
3793
|
* @param {any} srcObj
|
|
3762
3794
|
* @param {any} srcObj.mediaData overrides or adds metadata to the composed mediaData.
|
|
3763
3795
|
* @param {boolean} srcObj.disableTrackers
|
|
3764
|
-
* @param {
|
|
3796
|
+
* @param {MainResourceWithKeySystems} resource
|
|
3765
3797
|
*
|
|
3766
|
-
* @returns {
|
|
3798
|
+
* @returns {ComposedSrcMediaData}
|
|
3767
3799
|
*/
|
|
3768
3800
|
static composeSrcMediaData({
|
|
3769
3801
|
mediaData: srcMediaData,
|
|
@@ -3788,7 +3820,7 @@ class SrgSsr {
|
|
|
3788
3820
|
/**
|
|
3789
3821
|
* Create a new metadata text track.
|
|
3790
3822
|
*
|
|
3791
|
-
* @param {
|
|
3823
|
+
* @param {Player} player
|
|
3792
3824
|
* @param {String} trackId Text track unique ID
|
|
3793
3825
|
*
|
|
3794
3826
|
* @returns {Promise<TextTrack>}
|
|
@@ -3810,7 +3842,7 @@ class SrgSsr {
|
|
|
3810
3842
|
/**
|
|
3811
3843
|
* Proxy SRG SSR chapters and intervals cuechange events at player level.
|
|
3812
3844
|
*
|
|
3813
|
-
* @param {
|
|
3845
|
+
* @param {Player} player
|
|
3814
3846
|
*/
|
|
3815
3847
|
static cuechangeEventProxy(player) {
|
|
3816
3848
|
player.textTracks().on('addtrack', ({
|
|
@@ -3831,7 +3863,7 @@ class SrgSsr {
|
|
|
3831
3863
|
/**
|
|
3832
3864
|
* SRG SSR data provider singleton.
|
|
3833
3865
|
*
|
|
3834
|
-
* @param {
|
|
3866
|
+
* @param {Player} player
|
|
3835
3867
|
*
|
|
3836
3868
|
* @returns {DataProvider}
|
|
3837
3869
|
*/
|
|
@@ -3855,7 +3887,7 @@ class SrgSsr {
|
|
|
3855
3887
|
/**
|
|
3856
3888
|
* Set an error if something goes wrong with the data provider.
|
|
3857
3889
|
*
|
|
3858
|
-
* @param {
|
|
3890
|
+
* @param {Player} player
|
|
3859
3891
|
* @param {Object} error
|
|
3860
3892
|
*
|
|
3861
3893
|
* @returns {undefined|true}
|
|
@@ -3880,7 +3912,7 @@ class SrgSsr {
|
|
|
3880
3912
|
/**
|
|
3881
3913
|
* Set player error.
|
|
3882
3914
|
*
|
|
3883
|
-
* @param {
|
|
3915
|
+
* @param {Player} player
|
|
3884
3916
|
* @param {Object} error
|
|
3885
3917
|
*/
|
|
3886
3918
|
static error(player, {
|
|
@@ -3899,9 +3931,9 @@ class SrgSsr {
|
|
|
3899
3931
|
/**
|
|
3900
3932
|
* Filter out incompatible resources such as `RTMP` and `HDS`.
|
|
3901
3933
|
*
|
|
3902
|
-
* @param {Array.<
|
|
3934
|
+
* @param {Array.<MainResource>} resources Resources to filter
|
|
3903
3935
|
*
|
|
3904
|
-
* @returns {Array.<
|
|
3936
|
+
* @returns {Array.<MainResource>} The filtered resources
|
|
3905
3937
|
*/
|
|
3906
3938
|
static filterIncompatibleResources(resources = []) {
|
|
3907
3939
|
return resources.filter(resource => !['RTMP', 'HDS'].includes(resource.streaming));
|
|
@@ -3910,7 +3942,7 @@ class SrgSsr {
|
|
|
3910
3942
|
/**
|
|
3911
3943
|
* Get the current blocked segment from the player.
|
|
3912
3944
|
*
|
|
3913
|
-
* @param {
|
|
3945
|
+
* @param {Player} player
|
|
3914
3946
|
*
|
|
3915
3947
|
* @returns {VTTCue|undefined} The blocked segment cue object, or undefined
|
|
3916
3948
|
*/
|
|
@@ -3927,7 +3959,7 @@ class SrgSsr {
|
|
|
3927
3959
|
/**
|
|
3928
3960
|
* Get the VTT cue of a blocked segment.
|
|
3929
3961
|
*
|
|
3930
|
-
* @param {
|
|
3962
|
+
* @param {Player} player
|
|
3931
3963
|
* @param {Number} currentTime
|
|
3932
3964
|
*
|
|
3933
3965
|
* @returns {VTTCue|undefined} The VTT cue of a blocked segment, or undefined
|
|
@@ -3957,9 +3989,9 @@ class SrgSsr {
|
|
|
3957
3989
|
/**
|
|
3958
3990
|
* Get the mediaData most likely to be compatible depending on the browser.
|
|
3959
3991
|
*
|
|
3960
|
-
* @param {Array.<
|
|
3992
|
+
* @param {Array.<MainResourceWithKeySystems>} resources
|
|
3961
3993
|
*
|
|
3962
|
-
* @returns {
|
|
3994
|
+
* @returns {MainResourceWithKeySystems} By default, the first entry is used if none is compatible.
|
|
3963
3995
|
*/
|
|
3964
3996
|
static getMediaData(resources = []) {
|
|
3965
3997
|
if (AkamaiTokenService.hasToken(resources)) return resources[0];
|
|
@@ -3973,10 +4005,10 @@ class SrgSsr {
|
|
|
3973
4005
|
/**
|
|
3974
4006
|
* Get the source media object.
|
|
3975
4007
|
*
|
|
3976
|
-
* @param {
|
|
4008
|
+
* @param {Player} player
|
|
3977
4009
|
* @param {any} srcObj
|
|
3978
4010
|
*
|
|
3979
|
-
* @returns {Promise<
|
|
4011
|
+
* @returns {Promise<ComposedSrcMediaData>} - The composed source media data.
|
|
3980
4012
|
*/
|
|
3981
4013
|
static getSrcMediaObj(player, srcObj) {
|
|
3982
4014
|
return _asyncToGenerator(function* () {
|
|
@@ -4008,7 +4040,7 @@ class SrgSsr {
|
|
|
4008
4040
|
* _Note_: This function should disappear as soon as this behavior is
|
|
4009
4041
|
* supported on the packaging side.
|
|
4010
4042
|
*
|
|
4011
|
-
* @param {
|
|
4043
|
+
* @param {Player} player
|
|
4012
4044
|
* @param {number} currentTime
|
|
4013
4045
|
*
|
|
4014
4046
|
* @returns {number}
|
|
@@ -4040,7 +4072,7 @@ class SrgSsr {
|
|
|
4040
4072
|
* _Note_: This function should disappear as soon as this behavior is
|
|
4041
4073
|
* supported on the packaging side.
|
|
4042
4074
|
*
|
|
4043
|
-
* @param {
|
|
4075
|
+
* @param {Player} player
|
|
4044
4076
|
* @param {number} currentTime
|
|
4045
4077
|
*
|
|
4046
4078
|
* @returns {number}
|
|
@@ -4062,7 +4094,7 @@ class SrgSsr {
|
|
|
4062
4094
|
* - handle blocking reasons
|
|
4063
4095
|
* - add remote subtitles
|
|
4064
4096
|
*
|
|
4065
|
-
* @param {
|
|
4097
|
+
* @param {Player} player
|
|
4066
4098
|
* @param {any} srcObj
|
|
4067
4099
|
* @param {function} next
|
|
4068
4100
|
*
|
|
@@ -4088,7 +4120,7 @@ class SrgSsr {
|
|
|
4088
4120
|
/**
|
|
4089
4121
|
* SRG SSR analytics singleton.
|
|
4090
4122
|
*
|
|
4091
|
-
* @param {
|
|
4123
|
+
* @param {Player} player
|
|
4092
4124
|
*/
|
|
4093
4125
|
static srgAnalytics(player) {
|
|
4094
4126
|
if (player.options().trackers.srgAnalytics === false) return;
|
|
@@ -4109,7 +4141,7 @@ class SrgSsr {
|
|
|
4109
4141
|
/**
|
|
4110
4142
|
* PillarboxMonitoring monitoring singleton.
|
|
4111
4143
|
*
|
|
4112
|
-
* @param {
|
|
4144
|
+
* @param {Player} player
|
|
4113
4145
|
*
|
|
4114
4146
|
* @returns {PillarboxMonitoring} instance of PillarboxMonitoring
|
|
4115
4147
|
*/
|
|
@@ -4133,8 +4165,8 @@ class SrgSsr {
|
|
|
4133
4165
|
/**
|
|
4134
4166
|
* Update player's poster.
|
|
4135
4167
|
*
|
|
4136
|
-
* @param {
|
|
4137
|
-
* @param {
|
|
4168
|
+
* @param {Player} player
|
|
4169
|
+
* @param {ComposedSrcMediaData} srcMediaObj
|
|
4138
4170
|
* @param {Image} imageService
|
|
4139
4171
|
*/
|
|
4140
4172
|
static updatePoster(player, srcMediaObj, imageService = Image) {
|
|
@@ -4146,8 +4178,8 @@ class SrgSsr {
|
|
|
4146
4178
|
/**
|
|
4147
4179
|
* Update player titleBar with title and description.
|
|
4148
4180
|
*
|
|
4149
|
-
* @param {
|
|
4150
|
-
* @param {
|
|
4181
|
+
* @param {Player} player
|
|
4182
|
+
* @param {ComposedSrcMediaData} srcMediaObj
|
|
4151
4183
|
*/
|
|
4152
4184
|
static updateTitleBar(player, srcMediaObj) {
|
|
4153
4185
|
if (!player.titleBar) return;
|
|
@@ -4160,7 +4192,7 @@ class SrgSsr {
|
|
|
4160
4192
|
/**
|
|
4161
4193
|
* Middleware to resolve SRG SSR URNs into playable media.
|
|
4162
4194
|
*
|
|
4163
|
-
* @param {
|
|
4195
|
+
* @param {Player} player
|
|
4164
4196
|
*
|
|
4165
4197
|
* @returns {Object}
|
|
4166
4198
|
*/
|
|
@@ -4191,5 +4223,5 @@ pillarbox.options.srgOptions = {
|
|
|
4191
4223
|
tagCommanderScriptURL: undefined
|
|
4192
4224
|
};
|
|
4193
4225
|
|
|
4194
|
-
export { Player, SrgSsr, pillarbox as default };
|
|
4226
|
+
export { DataProvider, MediaComposition, PillarboxMonitoring, Player, SRGAnalytics, SrgSsr, pillarbox as default };
|
|
4195
4227
|
//# sourceMappingURL=pillarbox.es.js.map
|