@srgssr/pillarbox-web 1.27.0 → 1.29.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 +1 -19
- package/dist/pillarbox-core.cjs.map +1 -1
- package/dist/pillarbox-core.es.js +1 -19
- package/dist/pillarbox-core.es.js.map +1 -1
- package/dist/pillarbox.cjs +54 -66
- package/dist/pillarbox.cjs.map +1 -1
- package/dist/pillarbox.es.js +54 -66
- package/dist/pillarbox.es.js.map +1 -1
- package/dist/pillarbox.umd.js +54 -66
- 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/src/components/player.d.ts +0 -11
- package/dist/types/src/components/player.d.ts.map +1 -1
- package/dist/types/src/middleware/srgssr.d.ts +6 -4
- package/dist/types/src/middleware/srgssr.d.ts.map +1 -1
- package/dist/types/src/trackers/PillarboxMonitoring.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/pillarbox.es.js
CHANGED
|
@@ -90,7 +90,7 @@ function _toPropertyKey(t) {
|
|
|
90
90
|
return "symbol" == typeof i ? i : i + "";
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
-
const version = "1.
|
|
93
|
+
const version = "1.28.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,24 +249,6 @@ 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
|
-
|
|
270
252
|
/**
|
|
271
253
|
* A getter/setter for the media's text track.
|
|
272
254
|
* Activates the text track according to the language and kind properties.
|
|
@@ -1942,7 +1924,10 @@ class PillarboxMonitoring {
|
|
|
1942
1924
|
}
|
|
1943
1925
|
this.sendEvent('ERROR', _objectSpread2(_objectSpread2({
|
|
1944
1926
|
audio,
|
|
1945
|
-
log: JSON.stringify(error.metadata ||
|
|
1927
|
+
log: JSON.stringify(error.metadata || {
|
|
1928
|
+
history: pillarbox.log.history().slice(-15),
|
|
1929
|
+
playedRanges: this.player.playedRanges()
|
|
1930
|
+
}),
|
|
1946
1931
|
message: error.message,
|
|
1947
1932
|
name: PillarboxMonitoring.errorKeyCode(error.code)
|
|
1948
1933
|
}, playbackPosition), {}, {
|
|
@@ -2398,12 +2383,16 @@ class PillarboxMonitoring {
|
|
|
2398
2383
|
const stream_type = isFinite(this.player.duration()) ? 'On-demand' : 'Live';
|
|
2399
2384
|
const stall = this.stallInfo();
|
|
2400
2385
|
const subtitles = this.currentTextTrack();
|
|
2386
|
+
const log = JSON.stringify({
|
|
2387
|
+
playedRanges: this.player.playedRanges()
|
|
2388
|
+
});
|
|
2401
2389
|
const data = {
|
|
2402
2390
|
audio,
|
|
2403
2391
|
bandwidth,
|
|
2404
2392
|
bitrate,
|
|
2405
2393
|
buffered_duration,
|
|
2406
2394
|
frame_drops,
|
|
2395
|
+
log,
|
|
2407
2396
|
playback_duration,
|
|
2408
2397
|
position,
|
|
2409
2398
|
position_timestamp,
|
|
@@ -3657,21 +3646,17 @@ class SrgSsr {
|
|
|
3657
3646
|
* @param {Player} player
|
|
3658
3647
|
* @param {Array<Segment>} [segments=[]]
|
|
3659
3648
|
*/
|
|
3660
|
-
static addBlockedSegments(
|
|
3661
|
-
|
|
3662
|
-
|
|
3663
|
-
|
|
3664
|
-
|
|
3665
|
-
|
|
3666
|
-
|
|
3667
|
-
const blockedSegments = segments.filter(segment => segment.blockReason);
|
|
3668
|
-
if (!blockedSegments.length) return;
|
|
3669
|
-
SrgSsr.createTextTrack(player, trackId).then(segmentTrack => {
|
|
3649
|
+
static addBlockedSegments(_x) {
|
|
3650
|
+
return _asyncToGenerator(function* (player, segments = []) {
|
|
3651
|
+
const trackId = 'srgssr-blocked-segments';
|
|
3652
|
+
const segmentTrack = yield SrgSsr.createTextTrack(player, trackId);
|
|
3653
|
+
if (!Array.isArray(segments) || !segments.length) return;
|
|
3654
|
+
const blockedSegments = segments.filter(segment => segment.blockReason);
|
|
3655
|
+
if (!blockedSegments.length) return;
|
|
3670
3656
|
blockedSegments.forEach(segment => {
|
|
3671
3657
|
SrgSsr.addTextTrackCue(segmentTrack, segment);
|
|
3672
3658
|
});
|
|
3673
|
-
|
|
3674
|
-
});
|
|
3659
|
+
}).apply(this, arguments);
|
|
3675
3660
|
}
|
|
3676
3661
|
|
|
3677
3662
|
/**
|
|
@@ -3735,20 +3720,16 @@ class SrgSsr {
|
|
|
3735
3720
|
* @param {string} chapterUrn The URN of the main chapter.
|
|
3736
3721
|
* @param {Array.<Chapter>} [chapters=[]]
|
|
3737
3722
|
*/
|
|
3738
|
-
static addChapters(
|
|
3739
|
-
|
|
3740
|
-
|
|
3741
|
-
|
|
3742
|
-
|
|
3743
|
-
}
|
|
3744
|
-
if (!Array.isArray(chapters) || !chapters.length) return;
|
|
3745
|
-
SrgSsr.createTextTrack(player, trackId).then(chapterTrack => {
|
|
3723
|
+
static addChapters(_x2, _x3) {
|
|
3724
|
+
return _asyncToGenerator(function* (player, chapterUrn, chapters = []) {
|
|
3725
|
+
const trackId = 'srgssr-chapters';
|
|
3726
|
+
const chapterTrack = yield SrgSsr.createTextTrack(player, trackId);
|
|
3727
|
+
if (!Array.isArray(chapters) || !chapters.length) return;
|
|
3746
3728
|
chapters.forEach(chapter => {
|
|
3747
3729
|
if (chapterUrn !== chapter.fullLengthUrn) return;
|
|
3748
3730
|
SrgSsr.addTextTrackCue(chapterTrack, chapter);
|
|
3749
3731
|
});
|
|
3750
|
-
|
|
3751
|
-
});
|
|
3732
|
+
}).apply(this, arguments);
|
|
3752
3733
|
}
|
|
3753
3734
|
|
|
3754
3735
|
/**
|
|
@@ -3757,19 +3738,15 @@ class SrgSsr {
|
|
|
3757
3738
|
* @param {Player} player
|
|
3758
3739
|
* @param {Array.<TimeInterval>} [intervals=[]]
|
|
3759
3740
|
*/
|
|
3760
|
-
static addIntervals(
|
|
3761
|
-
|
|
3762
|
-
|
|
3763
|
-
|
|
3764
|
-
|
|
3765
|
-
}
|
|
3766
|
-
if (!Array.isArray(intervals) || !intervals.length) return;
|
|
3767
|
-
SrgSsr.createTextTrack(player, trackId).then(intervalTrack => {
|
|
3741
|
+
static addIntervals(_x4) {
|
|
3742
|
+
return _asyncToGenerator(function* (player, intervals = []) {
|
|
3743
|
+
const trackId = 'srgssr-intervals';
|
|
3744
|
+
const intervalTrack = yield SrgSsr.createTextTrack(player, trackId);
|
|
3745
|
+
if (!Array.isArray(intervals) || !intervals.length) return;
|
|
3768
3746
|
intervals.forEach(interval => {
|
|
3769
3747
|
SrgSsr.addTextTrackCue(intervalTrack, interval);
|
|
3770
3748
|
});
|
|
3771
|
-
|
|
3772
|
-
});
|
|
3749
|
+
}).apply(this, arguments);
|
|
3773
3750
|
}
|
|
3774
3751
|
|
|
3775
3752
|
/**
|
|
@@ -3873,7 +3850,9 @@ class SrgSsr {
|
|
|
3873
3850
|
}
|
|
3874
3851
|
|
|
3875
3852
|
/**
|
|
3876
|
-
* Create a new metadata text track.
|
|
3853
|
+
* Create a new metadata text track and add it to the player.
|
|
3854
|
+
*
|
|
3855
|
+
* If a text track with the same trackId exists, it is deleted beforehand.
|
|
3877
3856
|
*
|
|
3878
3857
|
* @param {Player} player
|
|
3879
3858
|
* @param {String} trackId Text track unique ID
|
|
@@ -3881,17 +3860,26 @@ class SrgSsr {
|
|
|
3881
3860
|
* @returns {Promise<TextTrack>}
|
|
3882
3861
|
*/
|
|
3883
3862
|
static createTextTrack(player, trackId) {
|
|
3884
|
-
|
|
3885
|
-
|
|
3886
|
-
|
|
3887
|
-
|
|
3888
|
-
|
|
3889
|
-
|
|
3890
|
-
|
|
3891
|
-
|
|
3892
|
-
|
|
3893
|
-
|
|
3894
|
-
|
|
3863
|
+
return _asyncToGenerator(function* () {
|
|
3864
|
+
const removeTrack = player.textTracks().getTrackById(trackId);
|
|
3865
|
+
if (removeTrack) {
|
|
3866
|
+
player.textTracks().removeTrack(removeTrack);
|
|
3867
|
+
}
|
|
3868
|
+
|
|
3869
|
+
// See https://github.com/videojs/video.js/issues/8519
|
|
3870
|
+
const textTrack = yield new Promise(resolve => {
|
|
3871
|
+
setTimeout(() => {
|
|
3872
|
+
resolve(new pillarbox.TextTrack({
|
|
3873
|
+
id: trackId,
|
|
3874
|
+
kind: 'metadata',
|
|
3875
|
+
label: trackId,
|
|
3876
|
+
tech: player.tech(true)
|
|
3877
|
+
}));
|
|
3878
|
+
}, 100);
|
|
3879
|
+
});
|
|
3880
|
+
player.textTracks().addTrack(textTrack);
|
|
3881
|
+
return textTrack;
|
|
3882
|
+
})();
|
|
3895
3883
|
}
|
|
3896
3884
|
|
|
3897
3885
|
/**
|
|
@@ -4034,7 +4022,7 @@ class SrgSsr {
|
|
|
4034
4022
|
*
|
|
4035
4023
|
* @returns {Promise<MediaComposition>}
|
|
4036
4024
|
*/
|
|
4037
|
-
static getMediaComposition(
|
|
4025
|
+
static getMediaComposition(_x5) {
|
|
4038
4026
|
return _asyncToGenerator(function* (urn, handleRequest = new DataProvider().handleRequest()) {
|
|
4039
4027
|
const data = yield handleRequest(urn);
|
|
4040
4028
|
return Object.assign(new MediaComposition(), data);
|
|
@@ -4261,7 +4249,7 @@ class SrgSsr {
|
|
|
4261
4249
|
var _ref = _asyncToGenerator(function* (srcObj, next) {
|
|
4262
4250
|
return SrgSsr.handleSetSource(player, srcObj, next);
|
|
4263
4251
|
});
|
|
4264
|
-
return function setSource(
|
|
4252
|
+
return function setSource(_x6, _x7) {
|
|
4265
4253
|
return _ref.apply(this, arguments);
|
|
4266
4254
|
};
|
|
4267
4255
|
}()
|