@srgssr/pillarbox-web 1.17.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.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/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
|
@@ -1,62 +1,58 @@
|
|
|
1
1
|
export default SRGAnalytics;
|
|
2
|
+
/** @import Player from 'video.js/dist/types/player' */
|
|
2
3
|
/**
|
|
3
|
-
* SRG analytics
|
|
4
|
-
* @class SRGAnalytics
|
|
5
|
-
* @ignore
|
|
4
|
+
* The SRG analytics class tracks media playback according to the standard defined by SRG SSR.
|
|
6
5
|
*
|
|
7
|
-
*
|
|
8
|
-
* JS script : https://colibri-js.akamaized.net/penguin/tc_SRGGD_11.js
|
|
6
|
+
* @class SRGAnalytics
|
|
9
7
|
*
|
|
10
8
|
* ### Official documentation
|
|
11
|
-
* Variables list
|
|
12
|
-
* @see https://confluence.srg.beecollaboration.com/display/INTFORSCHUNG/Datalayer+for+media+players
|
|
13
9
|
*
|
|
14
|
-
*
|
|
15
|
-
* @
|
|
10
|
+
* - [New variable list]{@link https://srgssr-ch.atlassian.net/wiki/spaces/INTFORSCHUNG/pages/1009353309/Labels+check+for+migration+of+integration+layer+in+SAM}
|
|
11
|
+
* - [Variables list]{@link https://srgssr-ch.atlassian.net/wiki/spaces/INTFORSCHUNG/pages/795904478/Datalayer+for+media+players}
|
|
12
|
+
* - [Standard event sequences]{@link https://srgssr-ch.atlassian.net/wiki/spaces/INTFORSCHUNG/pages/795904171/standard+streaming+events+sequence+of+events+for+media+player+actions}
|
|
13
|
+
* - [Review of Standard Media Actions]{@link https://srgssr-ch.atlassian.net/wiki/spaces/INTFORSCHUNG/pages/795902249/Implementation+Concept+-+draft}
|
|
14
|
+
* - [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}
|
|
16
15
|
*
|
|
17
|
-
*
|
|
18
|
-
* @see https://confluence.srg.beecollaboration.com/display/INTFORSCHUNG/Implementation+Concept+-+draft
|
|
16
|
+
* ### Script URL
|
|
19
17
|
*
|
|
20
|
-
*
|
|
21
|
-
* @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
|
|
18
|
+
* JS script : https://colibri-js.akamaized.net/penguin/tc_SRGGD_11.js
|
|
22
19
|
*
|
|
23
20
|
* ### Variables list
|
|
24
|
-
* - 'event_id', // init | play | stop | pos | pause | seek | uptime | eof
|
|
25
|
-
* - 'event_timestamp', // Seems to be generated automatically from the documentation, but the TP overrides it
|
|
26
|
-
* - 'event_name', // NA TP seems to not sending this variable
|
|
27
|
-
* - 'event_source', // NA TP seems to not sending this variable
|
|
28
|
-
* - 'event_name', // NA TP seems to not sending this variable
|
|
29
|
-
* - 'event_value', // NA TP seems to not sending this variable
|
|
30
|
-
* - 'navigation_environment', // prod | preprod
|
|
31
|
-
* - 'media_subtitles_on', // string true | false
|
|
32
|
-
* - 'media_timeshift', // need better description
|
|
33
|
-
* - 'media_quality', // SD | HD ?
|
|
34
|
-
* - 'media_bandwidth', // NA for the web, 64000
|
|
35
|
-
* - 'media_volume', // from 0 to 100
|
|
36
|
-
* - 'media_embedding_url', //
|
|
37
|
-
* - 'media_player_name', // videojs | letterbox-web ?
|
|
38
|
-
* - 'media_chromecast_selected', // boolean true | false
|
|
39
|
-
* - 'media_player_version', // player's version
|
|
40
|
-
* - 'media_player_display', // is the player mode, on the TP : inline, embed etc..
|
|
41
|
-
* - 'media_audio_track', // NA
|
|
42
|
-
* - 'media_position_real', // NA
|
|
43
|
-
* - 'media_time_spent', // NA
|
|
44
|
-
* - 'device_id', // NA
|
|
45
|
-
* - 'user_id_log_in', // NA only RTS has log in today
|
|
46
|
-
* - 'media_thumbnail', // Not required by the spec but sended by the TP
|
|
47
|
-
* - 'media_bu_distributer', // Not required by the spec but sended by the TP
|
|
48
21
|
*
|
|
22
|
+
* - event_id: init | play | stop | pos | pause | seek | uptime | eof
|
|
23
|
+
* - event_timestamp: Seems to be generated automatically from the documentation, but the TP overrides it
|
|
24
|
+
* - event_name: NA TP seems to not sending this variable
|
|
25
|
+
* - event_source: NA TP seems to not sending this variable
|
|
26
|
+
* - event_name: NA TP seems to not sending this variable
|
|
27
|
+
* - event_value: NA TP seems to not sending this variable
|
|
28
|
+
* - navigation_environment: prod | preprod
|
|
29
|
+
* - media_subtitles_on: string true | false
|
|
30
|
+
* - media_timeshift: need better description
|
|
31
|
+
* - media_quality: SD | HD ?
|
|
32
|
+
* - media_bandwidth: NA for the web, 64000
|
|
33
|
+
* - media_volume: from 0 to 100
|
|
34
|
+
* - media_embedding_url:
|
|
35
|
+
* - media_player_name: videojs | letterbox-web ?
|
|
36
|
+
* - media_chromecast_selected: boolean true | false
|
|
37
|
+
* - media_player_version: player's version
|
|
38
|
+
* - media_player_display: is the player mode, on the TP : inline, embed etc..
|
|
39
|
+
* - media_audio_track: NA
|
|
40
|
+
* - media_position_real: NA
|
|
41
|
+
* - media_time_spent: NA
|
|
42
|
+
* - device_id: NA
|
|
43
|
+
* - user_id_log_in: NA only RTS has log in today
|
|
44
|
+
* - media_thumbnail: Not required by the spec but sended by the TP
|
|
45
|
+
* - media_bu_distributer: Not required by the spec but sended by the TP
|
|
49
46
|
*
|
|
50
47
|
* ### Sequence stories
|
|
51
48
|
*
|
|
52
|
-
*
|
|
49
|
+
* #### Story 1 (AoD/VOD-basics): A VoD is played. The user does not interact with the player. The VoD plays to its end.
|
|
53
50
|
*
|
|
54
51
|
* Hints:
|
|
55
52
|
* - Media sessions always start with PLAY. They end with STOP or EOF (or with PAUSE or last POS)
|
|
56
53
|
* - POS is sent ever 30s
|
|
57
54
|
*
|
|
58
|
-
*
|
|
59
|
-
* __Story 2 (livestream-basics A)__: A Livestream is played. The user does not interact with the player. After 61 seconds, playback is paused.
|
|
55
|
+
* #### Story 2 (livestream-basics A): A Livestream is played. The user does not interact with the player. After 61 seconds, playback is paused.
|
|
60
56
|
*
|
|
61
57
|
* Hints:
|
|
62
58
|
* - Media sessions always start with PLAY. They end with STOP (or, worse for data quailty, with PAUSE or last POS/UPTIME)
|
|
@@ -64,14 +60,12 @@ export default SRGAnalytics;
|
|
|
64
60
|
* - POS is sent ever 30s, UPTIME every 60s with inital UPTIME after 30s.
|
|
65
61
|
* - This is the interval: 30s: POS + UPTIME; 60s: POS; 90s: POS + UPTIME; ...
|
|
66
62
|
*
|
|
67
|
-
*
|
|
68
|
-
* __Story 3 (Seeking a VoD/AoD)__: A VoD is played. User seeks in the VoD/AoD.
|
|
63
|
+
* #### Story 3 (Seeking a VoD/AoD): A VoD is played. User seeks in the VoD/AoD.
|
|
69
64
|
*
|
|
70
65
|
* Hints:
|
|
71
66
|
* - 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.
|
|
72
67
|
*
|
|
73
|
-
*
|
|
74
|
-
* __Story 4 (Seeking a livestream)__: A Livestream is played. User goes back in the livestream.
|
|
68
|
+
* #### Story 4 (Seeking a livestream): A Livestream is played. User goes back in the livestream.
|
|
75
69
|
*
|
|
76
70
|
* Hints:
|
|
77
71
|
* - 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.
|
|
@@ -86,15 +80,21 @@ declare class SRGAnalytics {
|
|
|
86
80
|
* @returns {Number} Timestamp in seconds
|
|
87
81
|
*/
|
|
88
82
|
static now(): number;
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
83
|
+
/**
|
|
84
|
+
* Creates an instance of SRGAnalytics.
|
|
85
|
+
*
|
|
86
|
+
* @constructor
|
|
87
|
+
* @param {Player} player The player instance
|
|
88
|
+
* @param {SRGAnalyticsOptions} [options={}] Configuration options
|
|
89
|
+
* @param {boolean} [options.debug=false] Enables debug mode if set to true
|
|
90
|
+
* @param {string} [options.environment='prod'] The environment in which the data is sent
|
|
91
|
+
* @param {string} [options.playerVersion='none'] The version of the player
|
|
92
|
+
* @param {string} [options.tagCommanderScriptURL='//colibri-js.akamaized.net/penguin/tc_SRGGD_11.js'] The URL for the Tag Commander script
|
|
93
|
+
*/
|
|
94
|
+
constructor(player: Player, { debug, environment, playerVersion, tagCommanderScriptURL, }?: SRGAnalyticsOptions);
|
|
95
|
+
isDebugEnabled: SRGAnalyticsOptions;
|
|
96
96
|
elapsedPlaybackTime: number;
|
|
97
|
-
environment:
|
|
97
|
+
environment: SRGAnalyticsOptions;
|
|
98
98
|
hasStarted: boolean;
|
|
99
99
|
heartBeatIntervalId: NodeJS.Timeout;
|
|
100
100
|
initialized: boolean;
|
|
@@ -103,11 +103,11 @@ declare class SRGAnalytics {
|
|
|
103
103
|
mediaSession: number;
|
|
104
104
|
pendingQueue: any[];
|
|
105
105
|
pendingTagCommanderReload: boolean;
|
|
106
|
-
player:
|
|
107
|
-
playerVersion:
|
|
106
|
+
player: Player;
|
|
107
|
+
playerVersion: SRGAnalyticsOptions;
|
|
108
108
|
srcMediaData: any;
|
|
109
109
|
startPlaybackSession: number;
|
|
110
|
-
tagCommanderScriptURL:
|
|
110
|
+
tagCommanderScriptURL: SRGAnalyticsOptions;
|
|
111
111
|
trackedCurrentTime: number;
|
|
112
112
|
uptimeIntervalId: NodeJS.Timeout;
|
|
113
113
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SRGAnalytics.d.ts","sourceRoot":"","sources":["../../../../src/trackers/SRGAnalytics.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"SRGAnalytics.d.ts","sourceRoot":"","sources":["../../../../src/trackers/SRGAnalytics.js"],"names":[],"mappings":";AAGA,uDAAuD;AAMvD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwEG;AACH;IAsnBE;;;;OAIG;IACH,qBAEC;IA5nBD;;;;;;;;;;OAUG;IACH,iHA+BC;IAtBC,oCAA2B;IAC3B,4BAA4B;IAC5B,iCAA8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AIG;IACH,mBAKC;IAED;;;;;;OAMG;IACH,oEASC;IAED;;;;OAIG;IACH,oDA6BC;IAWD;;;;OAIG;IACH,aAkBC;IAED;;;;;;;;OAQG;IACH,cAoBC;IAED;;;;;OAKG;IACH,mBAEC;IAED;;OAEG;IACH,oCAOC;IAED;;;;OAIG;IACH,gBAKC;IAED;;;;OAIG;IACH,mBAIC;IAED;;;;OAIG;IACH,sBASC;IAED;;OAEG;IACH,4CAEC;IAED;;;;;;;OAOG;IACH,eAkBC;IAVC,gCASS;IAGX;;;;;;;;;;OAUG;IACH,gBAsBC;CACF"}
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"typedef.d.ts","sourceRoot":"","sources":["../../../../src/components/typedef.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;CACd,CAAC"}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { MainResource } from '../dataProvider/model/typedef';
|
|
2
|
-
import { KeySystems } from '../utils/typedef';
|
|
3
|
-
/**
|
|
4
|
-
* A {@link MainResource} that can contain {@link KeySystems} information.
|
|
5
|
-
*/
|
|
6
|
-
export interface MainResourceWithKeySystems extends MainResource, KeySystems {
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* Represents the result of composing source media data.
|
|
10
|
-
*/
|
|
11
|
-
export type ComposedSrcMediaData = {
|
|
12
|
-
/**
|
|
13
|
-
* The URL of the source media.
|
|
14
|
-
*/
|
|
15
|
-
src: string;
|
|
16
|
-
/**
|
|
17
|
-
* The MIME type of the source media.
|
|
18
|
-
*/
|
|
19
|
-
type: string;
|
|
20
|
-
/**
|
|
21
|
-
* A mapping of DRM types to their corresponding key systems information.
|
|
22
|
-
*/
|
|
23
|
-
keySystems: KeySystems;
|
|
24
|
-
/**
|
|
25
|
-
* Indicates whether trackers are disabled for the source media.
|
|
26
|
-
*/
|
|
27
|
-
disableTrackers: boolean;
|
|
28
|
-
/**
|
|
29
|
-
* The merged media data from the source and additional media data.
|
|
30
|
-
*/
|
|
31
|
-
mediaData: MainResource;
|
|
32
|
-
};
|
|
33
|
-
/**
|
|
34
|
-
* Represents a set of options specific to the SRG SSR.
|
|
35
|
-
*
|
|
36
|
-
* __Note__:
|
|
37
|
-
*
|
|
38
|
-
* - All these options have a default value and can therefore be undefined.
|
|
39
|
-
* - DataProvider options cannot be combined with each other.
|
|
40
|
-
*/
|
|
41
|
-
export type SrgOptions = {
|
|
42
|
-
/**
|
|
43
|
-
* A function returning an object representing a mediaComposition.
|
|
44
|
-
*
|
|
45
|
-
* @example
|
|
46
|
-
* // Must match the following signature
|
|
47
|
-
* (data: string) => any
|
|
48
|
-
*/
|
|
49
|
-
dataProvider: undefined | Function;
|
|
50
|
-
/**
|
|
51
|
-
* A specific host for a different IL environment.
|
|
52
|
-
*/
|
|
53
|
-
dataProviderHost: undefined | string;
|
|
54
|
-
/**
|
|
55
|
-
* A function for handling a custom data source.
|
|
56
|
-
*
|
|
57
|
-
* @example
|
|
58
|
-
* // Must match the following signature
|
|
59
|
-
* (contentId: string) => string
|
|
60
|
-
*/
|
|
61
|
-
dataProviderUrlHandler: undefined | Function;
|
|
62
|
-
/**
|
|
63
|
-
* The URL of the TagCommander script.
|
|
64
|
-
*/
|
|
65
|
-
tagCommanderScriptURL: undefined | string;
|
|
66
|
-
};
|
|
67
|
-
//# sourceMappingURL=typedef.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"typedef.d.ts","sourceRoot":"","sources":["../../../../src/middleware/typedef.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAG9C;;GAEG;AACH,MAAM,WAAW,0BAA2B,SAAQ,YAAY,EAAE,UAAU;CAE3E;AAED;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,UAAU,EAAE,UAAU,CAAC;IACvB;;OAEG;IACH,eAAe,EAAE,OAAO,CAAC;IACzB;;OAEG;IACH,SAAS,EAAE,YAAY,CAAC;CACzB,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB;;;;;;OAMG;IACH,YAAY,EAAE,SAAS,GAAG,QAAQ,CAAC;IACnC;;OAEG;IACH,gBAAgB,EAAE,SAAS,GAAG,MAAM,CAAC;IACrC;;;;;;OAMG;IACH,sBAAsB,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC7C;;OAEG;IACH,qBAAqB,EAAE,SAAS,GAAG,MAAM,CAAC;CAC3C,CAAA"}
|