@srgssr/pillarbox-web 1.31.0 → 1.32.1

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.
@@ -93,7 +93,7 @@
93
93
  return "symbol" == typeof i ? i : i + "";
94
94
  }
95
95
 
96
- const version$8 = "1.30.0";
96
+ const version$8 = "1.32.0";
97
97
 
98
98
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
99
99
 
@@ -7459,7 +7459,7 @@
7459
7459
  function requireEntities () {
7460
7460
  if (hasRequiredEntities) return entities;
7461
7461
  hasRequiredEntities = 1;
7462
- (function (exports) {
7462
+ (function (exports$1) {
7463
7463
 
7464
7464
  var freeze = requireConventions().freeze;
7465
7465
 
@@ -7470,7 +7470,7 @@
7470
7470
  * @see https://www.w3.org/TR/2008/REC-xml-20081126/#sec-predefined-ent W3C XML 1.0
7471
7471
  * @see https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references#Predefined_entities_in_XML Wikipedia
7472
7472
  */
7473
- exports.XML_ENTITIES = freeze({
7473
+ exports$1.XML_ENTITIES = freeze({
7474
7474
  amp: '&',
7475
7475
  apos: "'",
7476
7476
  gt: '>',
@@ -7492,7 +7492,7 @@
7492
7492
  * @see https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references#Character_entity_references_in_HTML Wikipedia (HTML)
7493
7493
  * @see https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references#Entities_representing_special_characters_in_XHTML Wikpedia (XHTML)
7494
7494
  */
7495
- exports.HTML_ENTITIES = freeze({
7495
+ exports$1.HTML_ENTITIES = freeze({
7496
7496
  Aacute: '\u00C1',
7497
7497
  aacute: '\u00E1',
7498
7498
  Abreve: '\u0102',
@@ -9624,7 +9624,7 @@
9624
9624
  * @deprecated use `HTML_ENTITIES` instead
9625
9625
  * @see HTML_ENTITIES
9626
9626
  */
9627
- exports.entityMap = exports.HTML_ENTITIES;
9627
+ exports$1.entityMap = exports$1.HTML_ENTITIES;
9628
9628
  } (entities));
9629
9629
  return entities;
9630
9630
  }
@@ -30301,7 +30301,7 @@
30301
30301
  *
30302
30302
  * @extends ClickableComponent
30303
30303
  */
30304
- class MenuItem extends ClickableComponent {
30304
+ let MenuItem$1 = class MenuItem extends ClickableComponent {
30305
30305
  /**
30306
30306
  * Creates an instance of the this class.
30307
30307
  *
@@ -30422,8 +30422,8 @@
30422
30422
  }
30423
30423
  }
30424
30424
  }
30425
- }
30426
- Component$1.registerComponent('MenuItem', MenuItem);
30425
+ };
30426
+ Component$1.registerComponent('MenuItem', MenuItem$1);
30427
30427
 
30428
30428
  /**
30429
30429
  * @file text-track-menu-item.js
@@ -30436,7 +30436,7 @@
30436
30436
  *
30437
30437
  * @extends MenuItem
30438
30438
  */
30439
- class TextTrackMenuItem extends MenuItem {
30439
+ class TextTrackMenuItem extends MenuItem$1 {
30440
30440
  /**
30441
30441
  * Creates an instance of this class.
30442
30442
  *
@@ -30771,7 +30771,7 @@
30771
30771
  *
30772
30772
  * @extends MenuItem
30773
30773
  */
30774
- class ChaptersTrackMenuItem extends MenuItem {
30774
+ class ChaptersTrackMenuItem extends MenuItem$1 {
30775
30775
  /**
30776
30776
  * Creates an instance of this class.
30777
30777
  *
@@ -31444,7 +31444,7 @@
31444
31444
  *
31445
31445
  * @extends MenuItem
31446
31446
  */
31447
- class AudioTrackMenuItem extends MenuItem {
31447
+ let AudioTrackMenuItem$1 = class AudioTrackMenuItem extends MenuItem$1 {
31448
31448
  /**
31449
31449
  * Creates an instance of this class.
31450
31450
  *
@@ -31533,8 +31533,8 @@
31533
31533
  handleTracksChange(event) {
31534
31534
  this.selected(this.track.enabled);
31535
31535
  }
31536
- }
31537
- Component$1.registerComponent('AudioTrackMenuItem', AudioTrackMenuItem);
31536
+ };
31537
+ Component$1.registerComponent('AudioTrackMenuItem', AudioTrackMenuItem$1);
31538
31538
 
31539
31539
  /**
31540
31540
  * @file audio-track-button.js
@@ -31545,7 +31545,7 @@
31545
31545
  *
31546
31546
  * @extends TrackButton
31547
31547
  */
31548
- class AudioTrackButton extends TrackButton {
31548
+ let AudioTrackButton$1 = class AudioTrackButton extends TrackButton {
31549
31549
  /**
31550
31550
  * Creates an instance of this class.
31551
31551
  *
@@ -31589,7 +31589,7 @@
31589
31589
  const tracks = this.player_.audioTracks();
31590
31590
  for (let i = 0; i < tracks.length; i++) {
31591
31591
  const track = tracks[i];
31592
- items.push(new AudioTrackMenuItem(this.player_, {
31592
+ items.push(new AudioTrackMenuItem$1(this.player_, {
31593
31593
  track,
31594
31594
  // MenuItem is selectable
31595
31595
  selectable: true,
@@ -31599,7 +31599,7 @@
31599
31599
  }
31600
31600
  return items;
31601
31601
  }
31602
- }
31602
+ };
31603
31603
 
31604
31604
  /**
31605
31605
  * The text that should display over the `AudioTrackButton`s controls. Added for localization.
@@ -31607,8 +31607,8 @@
31607
31607
  * @type {string}
31608
31608
  * @protected
31609
31609
  */
31610
- AudioTrackButton.prototype.controlText_ = 'Audio Track';
31611
- Component$1.registerComponent('AudioTrackButton', AudioTrackButton);
31610
+ AudioTrackButton$1.prototype.controlText_ = 'Audio Track';
31611
+ Component$1.registerComponent('AudioTrackButton', AudioTrackButton$1);
31612
31612
 
31613
31613
  /**
31614
31614
  * @file playback-rate-menu-item.js
@@ -31621,7 +31621,7 @@
31621
31621
  *
31622
31622
  * @extends MenuItem
31623
31623
  */
31624
- class PlaybackRateMenuItem extends MenuItem {
31624
+ class PlaybackRateMenuItem extends MenuItem$1 {
31625
31625
  /**
31626
31626
  * Creates an instance of this class.
31627
31627
  *
@@ -71148,6 +71148,151 @@ ${segmentInfoString(segmentInfo)}`); // If there's an init segment associated wi
71148
71148
  }
71149
71149
  videojs.registerComponent('player', Player);
71150
71150
 
71151
+ /** @import MenuItem from 'video.js/dist/types/menu/menu-item' */
71152
+
71153
+ /**
71154
+ * @ignore
71155
+ */
71156
+ const VJSAudioTrackButton = videojs.getComponent('AudioTrackButton');
71157
+
71158
+ /**
71159
+ * @ignore
71160
+ * @type {typeof MenuItem}
71161
+ */
71162
+ const MenuItem = videojs.getComponent('MenuItem');
71163
+
71164
+ /**
71165
+ * An {@link AudioTrack} {@link MenuItem}
71166
+ *
71167
+ * This is a temporary workaround.
71168
+ *
71169
+ * @extends MenuItem
71170
+ */
71171
+ class AudioTrackMenuItem extends MenuItem {
71172
+ /**
71173
+ * Creates an instance of this class.
71174
+ *
71175
+ * @param {Player} player
71176
+ * The `Player` that this class should be attached to.
71177
+ *
71178
+ * @param {Object} [options]
71179
+ * The key/value store of player options.
71180
+ */
71181
+ constructor(player, options) {
71182
+ const track = options.track;
71183
+ const tracks = player.audioTracks();
71184
+
71185
+ // Modify options for parent MenuItem class's init.
71186
+ options.label = track.label || track.language || 'Unknown';
71187
+ options.selected = track.enabled;
71188
+ super(player, options);
71189
+ this.track = track;
71190
+ this.addClass(`vjs-${track.kind}-menu-item`);
71191
+ const changeHandler = (...args) => {
71192
+ this.handleTracksChange.apply(this, args);
71193
+ };
71194
+ tracks.addEventListener('change', changeHandler);
71195
+ this.on('dispose', () => {
71196
+ tracks.removeEventListener('change', changeHandler);
71197
+ });
71198
+ }
71199
+ createEl(type, props, attrs) {
71200
+ const el = super.createEl(type, props, attrs);
71201
+ const parentSpan = el.querySelector('.vjs-menu-item-text');
71202
+ if (['main-desc', 'descriptions', 'description'].indexOf(this.options_.track.kind) >= 0) {
71203
+ parentSpan.appendChild(videojs.dom.createEl('span', {
71204
+ className: 'vjs-icon-placeholder'
71205
+ }, {
71206
+ 'aria-hidden': true
71207
+ }));
71208
+ parentSpan.appendChild(videojs.dom.createEl('span', {
71209
+ className: 'vjs-control-text',
71210
+ textContent: ' ' + this.localize('Descriptions')
71211
+ }));
71212
+ }
71213
+ return el;
71214
+ }
71215
+
71216
+ /**
71217
+ * This gets called when an `AudioTrackMenuItem is "clicked". See {@link ClickableComponent}
71218
+ * for more detailed information on what a click can be.
71219
+ *
71220
+ * @param {Event} [event]
71221
+ * The `keydown`, `tap`, or `click` event that caused this function to be
71222
+ * called.
71223
+ *
71224
+ * @listens tap
71225
+ * @listens click
71226
+ */
71227
+ handleClick(event) {
71228
+ super.handleClick(event);
71229
+
71230
+ // the audio track list will automatically toggle other tracks
71231
+ // off for us.
71232
+ this.track.enabled = true;
71233
+ if (!this.player_.tech_.featuresNativeAudioTracks) return;
71234
+
71235
+ // when native audio tracks are used, we want to make sure that other tracks are turned off
71236
+ const tracks = this.player_.audioTracks();
71237
+ for (let i = 0; i < tracks.length; i++) {
71238
+ const track = tracks[i];
71239
+
71240
+ // skip the current track since we enabled it above
71241
+ if (track === this.track) {
71242
+ continue;
71243
+ }
71244
+ track.enabled = track === this.track;
71245
+ }
71246
+ }
71247
+
71248
+ /**
71249
+ * Handle any {@link AudioTrack} change.
71250
+ *
71251
+ * @param {Event} [event]
71252
+ * The {@link AudioTrackList#change} event that caused this to run.
71253
+ *
71254
+ * @listens AudioTrackList#change
71255
+ */
71256
+ handleTracksChange() {
71257
+ this.selected(this.track.enabled);
71258
+ }
71259
+ }
71260
+
71261
+ /**
71262
+ * The base class for buttons that toggle specific {@link AudioTrack} types.
71263
+ *
71264
+ * @extends VJSAudioTrackButton
71265
+ */
71266
+ class AudioTrackButton extends VJSAudioTrackButton {
71267
+ /**
71268
+ * Create a menu item for each audio track
71269
+ *
71270
+ * @param {AudioTrackMenuItem[]} [items=[]]
71271
+ * An array of existing menu items to use.
71272
+ *
71273
+ * @return {AudioTrackMenuItem[]}
71274
+ * An array of menu items
71275
+ */
71276
+ createItems(items = []) {
71277
+ // if there's only one audio track, there no point in showing it
71278
+ this.hideThreshold_ = 1;
71279
+ const tracks = this.player_.audioTracks();
71280
+ for (let i = 0; i < tracks.length; i++) {
71281
+ const track = tracks[i];
71282
+ items.push(new AudioTrackMenuItem(this.player_, {
71283
+ track,
71284
+ // MenuItem is selectable
71285
+ selectable: true,
71286
+ // MenuItem is NOT multiSelectable (i.e. only one can be marked "selected" at a time)
71287
+ multiSelectable: false
71288
+ }));
71289
+ }
71290
+ return items;
71291
+ }
71292
+ }
71293
+ videojs.registerComponent('AudioTrackMenuItem', AudioTrackMenuItem);
71294
+ videojs.registerComponent('AudioTrackButton', AudioTrackButton);
71295
+
71151
71296
  /**
71152
71297
  * Pillarbox is an alias for the video.js namespace with additional options.
71153
71298
  *
@@ -71331,7 +71476,7 @@ ${segmentInfoString(segmentInfo)}`); // If there's an init segment associated wi
71331
71476
  * @property {String} [image.format=jpg] is the format of the image, default value jpg.
71332
71477
  * @property {String} [imageServiceUrl] Url of the image service that needs to comply with the specification defined by the IL.
71333
71478
  *
71334
- * @see https://confluence.srg.beecollaboration.com/pages/viewpage.action?spaceKey=SRGPLAY&title=Project+-+Image+Service
71479
+ * @see https://srgssr-ch.atlassian.net/wiki/spaces/SRGPLAY/pages/799082429/Project+-+Image+Service
71335
71480
  *
71336
71481
  * @returns {String|undefined} the image scaling URL.
71337
71482
  */
@@ -72076,7 +72221,7 @@ ${segmentInfoString(segmentInfo)}`); // If there's an init segment associated wi
72076
72221
  * - pos should be sent when the media player is in "play mode".
72077
72222
  * - once the video is paused or stopped, the timer for sending these actions must be stopped.
72078
72223
  *
72079
- * @see https://confluence.srg.beecollaboration.com/display/INTFORSCHUNG/standard+streaming+events%3A+sequence+of+events+for+media+player+actions#standardstreamingevents:sequenceofeventsformediaplayeractions-mandatoryplayerevents
72224
+ * @see https://srgssr-ch.atlassian.net/wiki/spaces/INTFORSCHUNG/pages/795904171/standard+streaming+events+sequence+of+events+for+media+player+actions#mandatory-player-events
72080
72225
  */
72081
72226
  heartBeat() {
72082
72227
  this.heartBeatIntervalId = setInterval(() => {
@@ -72367,7 +72512,7 @@ ${segmentInfoString(segmentInfo)}`); // If there's an init segment associated wi
72367
72512
  * Sent to ComScore when the playback rate changes.
72368
72513
  *
72369
72514
  * @see https://github.com/SRGSSR/srgletterbox-web/issues/761
72370
- * @see https://jira.srg.beecollaboration.com/browse/ADI-256
72515
+ * @see https://srgssr-ch.atlassian.net/browse/ADI-256
72371
72516
  */
72372
72517
  rateChange() {
72373
72518
  this.notify('change_playback_rate');
@@ -72461,11 +72606,11 @@ ${segmentInfoString(segmentInfo)}`); // If there's an init segment associated wi
72461
72606
  * It's expected notifyBufferStart() to be called when the player starts buffering
72462
72607
  * and a call to notifyBufferStop() when content resumes after buffering.
72463
72608
  *
72464
- * @see Item 2: https://jira.srg.beecollaboration.com/browse/PLAY-2628
72609
+ * @see Item 2: https://srgssr-ch.atlassian.net/browse/PLAY-2628
72465
72610
  *
72466
72611
  * After the issue PLAYRTS-321
72467
- * @see Fix: https://jira.srg.beecollaboration.com/browse/PLAYRTS-321?focusedCommentId=201023&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-201023
72468
- * @see Fix: https://jira.srg.beecollaboration.com/browse/PLAYRTS-3065
72612
+ * @see Fix: https://srgssr-ch.atlassian.net/browse/PLAYRTS-321?focusedCommentId=201023&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-201023
72613
+ * @see Fix: https://srgssr-ch.atlassian.net/browse/PLAYRTS-3065
72469
72614
  */
72470
72615
  waiting() {
72471
72616
  if (!this.initialized || this.isWaiting) {
@@ -75066,6 +75211,7 @@ ${segmentInfoString(segmentInfo)}`); // If there's an init segment associated wi
75066
75211
  if (!player.options().trackers.srgAnalytics) {
75067
75212
  const srgAnalytics = new SRGAnalytics(player, {
75068
75213
  debug: player.debug(),
75214
+ environment: player.options().srgOptions.analyticsEnvironment,
75069
75215
  playerVersion: pillarbox.VERSION.pillarbox,
75070
75216
  tagCommanderScriptURL: player.options().srgOptions.tagCommanderScriptURL
75071
75217
  });
@@ -75159,6 +75305,7 @@ ${segmentInfoString(segmentInfo)}`); // If there's an init segment associated wi
75159
75305
  dataProvider: undefined,
75160
75306
  dataProviderHost: undefined,
75161
75307
  dataProviderUrlHandler: undefined,
75308
+ analyticsEnvironment: undefined,
75162
75309
  tagCommanderScriptURL: undefined
75163
75310
  };
75164
75311