@srgssr/pillarbox-web 1.25.0 → 1.27.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.
@@ -90,7 +90,7 @@ function _toPropertyKey(t) {
90
90
  return "symbol" == typeof i ? i : i + "";
91
91
  }
92
92
 
93
- const version = "1.24.1";
93
+ const version = "1.26.0";
94
94
 
95
95
  /** @import VJSPlayer from 'video.js/dist/types/player' */
96
96
  /** @import AudioTrack from 'video.js/dist/types/tracks/audio-track' */
@@ -249,6 +249,24 @@ class Player extends vjsPlayer {
249
249
  return ranges;
250
250
  }
251
251
 
252
+ /**
253
+ * Overrides the default `src` behavior to ensure the underlying tech is fully
254
+ * reset before setting a new source.
255
+ *
256
+ * This is a workaround for a Video.js issue where, under certain failure cases the
257
+ * internal `src_` reload logic is not triggered. As a result, the previous media
258
+ * can continue playing in the background even though the new source failed.
259
+ *
260
+ * @see https://docs.videojs.com/player#src
261
+ */
262
+ src(source) {
263
+ if (source) {
264
+ this.poster(null);
265
+ this.techCall_('reset');
266
+ }
267
+ super.src(source);
268
+ }
269
+
252
270
  /**
253
271
  * A getter/setter for the media's text track.
254
272
  * Activates the text track according to the language and kind properties.
@@ -2758,6 +2776,8 @@ class MediaComposition {
2758
2776
  tokenType: resource.tokenType,
2759
2777
  url: resource.url,
2760
2778
  urn: this.chapterUrn,
2779
+ validFrom: this.getMainValidFromDate(),
2780
+ validTo: this.getMainValidToDate(),
2761
2781
  vendor: this.getMainChapter().vendor
2762
2782
  }));
2763
2783
  }
@@ -2790,19 +2810,27 @@ class MediaComposition {
2790
2810
  /**
2791
2811
  * Compute a date from which this content is valid. Always return a date object.
2792
2812
  *
2793
- * @returns {Date} date specified in media composition or EPOCH when no date present.
2813
+ * @returns {Date} date specified in media composition or undefined.
2794
2814
  */
2795
2815
  getMainValidFromDate() {
2796
- const mainChapter = this.getMainChapter();
2797
- if (!mainChapter) {
2798
- return new Date(0);
2799
- }
2800
2816
  const {
2801
2817
  validFrom
2802
- } = mainChapter;
2803
- if (validFrom) {
2804
- return new Date(validFrom);
2805
- }
2818
+ } = this.getMainChapter() || {};
2819
+ if (!validFrom) return;
2820
+ return new Date(validFrom);
2821
+ }
2822
+
2823
+ /**
2824
+ * Compute a date to which this content is valid. Always return a date object.
2825
+ *
2826
+ * @returns {Date} date specified in media composition or undefined.
2827
+ */
2828
+ getMainValidToDate() {
2829
+ const {
2830
+ validTo
2831
+ } = this.getMainChapter() || {};
2832
+ if (!validTo) return;
2833
+ return new Date(validTo);
2806
2834
  }
2807
2835
 
2808
2836
  /**
@@ -3468,7 +3496,7 @@ const pillarboxLang$1 = {
3468
3496
 
3469
3497
  pillarbox.addLanguage('it', _objectSpread2(_objectSpread2({}, vjsLang), pillarboxLang$1));
3470
3498
 
3471
- const Play = "Laschar ir";
3499
+ const Play = "Start";
3472
3500
  const Pause = "Pausa";
3473
3501
  const Replay = "Mussar danovamain";
3474
3502
  const Duration = "Durada";
@@ -3544,12 +3572,12 @@ const pillarboxLang = {
3544
3572
  "descriptions off": "senza descripziuns",
3545
3573
  "Audio Track": "Piese audio",
3546
3574
  "Volume Level": "Nivel dal volumen",
3547
- "You aborted the media playback": "Vus avais interrut il vdieo",
3575
+ "You aborted the media playback": "Vus avais interrut la reproducziun",
3548
3576
  "A network error caused the media download to fail part-way.": "In sbagl en la rait ha impedì il download",
3549
- "The media could not be loaded, either because the server or network failed or because the format is not supported.": "Il video n'è betg chargià - ubain per in sbagl da server / da la rait, ubain ch'il format n'è betg cumpatibel.",
3550
- "The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "Il video è interrut: Ubain ch'il video è donnegià, ubain che funcziuns n'èn betg cumpatiblas.",
3551
- "No compatible source was found for this media.": "Chattà nagina funtauna cumpatibla per quest video.",
3552
- "The media is encrypted and we do not have the keys to decrypt it.": "Il video è codifitgà da moda nunenconuschenta.",
3577
+ "The media could not be loaded, either because the server or network failed or because the format is not supported.": "Il medium n'ha betg pudì vegnir chargià u pervia d'in sbagl da server u da la rait, u perquai ch'il format n'è betg cumpatibel.",
3578
+ "The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "La reproducziun è vegnida interrutta u perquai ch'il cuntegn è donnegià, u perquai ch’il medium dovra funcziuns che voss navigatur na sustegna betg.",
3579
+ "No compatible source was found for this media.": "Chattà nagina funtauna cumpatibla per quest medium.",
3580
+ "The media is encrypted and we do not have the keys to decrypt it.": "Il medium è codà e nus n’avain naginas clavs per al decodar.",
3553
3581
  "Play Video": "Aviar video",
3554
3582
  Close,
3555
3583
  "Close Modal Dialog": "Serrar la fanestra modala",