@srgssr/pillarbox-web 1.21.1 → 1.22.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.
Files changed (38) hide show
  1. package/README.md +9 -2
  2. package/dist/pillarbox-core.cjs.js +1 -1
  3. package/dist/pillarbox-core.cjs.js.map +1 -1
  4. package/dist/pillarbox-core.es.js +1 -1
  5. package/dist/pillarbox-core.es.js.map +1 -1
  6. package/dist/pillarbox.cjs.js +63 -80
  7. package/dist/pillarbox.cjs.js.map +1 -1
  8. package/dist/pillarbox.es.js +63 -80
  9. package/dist/pillarbox.es.js.map +1 -1
  10. package/dist/pillarbox.min.css +1 -1
  11. package/dist/pillarbox.min.css.map +1 -1
  12. package/dist/pillarbox.umd.js +78 -903
  13. package/dist/pillarbox.umd.js.map +1 -1
  14. package/dist/pillarbox.umd.min.js +9 -20
  15. package/dist/pillarbox.umd.min.js.map +1 -1
  16. package/dist/types/src/components/player.d.ts +7 -3
  17. package/dist/types/src/components/player.d.ts.map +1 -1
  18. package/dist/types/src/components/typedef.d.ts +14 -0
  19. package/dist/types/src/components/typedef.d.ts.map +1 -0
  20. package/dist/types/src/dataProvider/model/MediaComposition.d.ts +10 -10
  21. package/dist/types/src/dataProvider/model/MediaComposition.d.ts.map +1 -1
  22. package/dist/types/src/dataProvider/services/DataProvider.d.ts +1 -0
  23. package/dist/types/src/dataProvider/services/DataProvider.d.ts.map +1 -1
  24. package/dist/types/src/middleware/srgssr.d.ts +8 -0
  25. package/dist/types/src/middleware/srgssr.d.ts.map +1 -1
  26. package/dist/types/src/middleware/typedef.d.ts +67 -0
  27. package/dist/types/src/middleware/typedef.d.ts.map +1 -0
  28. package/dist/types/src/trackers/PillarboxMonitoring.d.ts +4 -3
  29. package/dist/types/src/trackers/PillarboxMonitoring.d.ts.map +1 -1
  30. package/dist/types/src/trackers/SRGAnalytics.d.ts +1 -0
  31. package/dist/types/src/trackers/SRGAnalytics.d.ts.map +1 -1
  32. package/dist/types/src/utils/AkamaiTokenService.d.ts +3 -3
  33. package/dist/types/src/utils/AkamaiTokenService.d.ts.map +1 -1
  34. package/dist/types/src/utils/Drm.d.ts +2 -2
  35. package/dist/types/src/utils/Drm.d.ts.map +1 -1
  36. package/dist/types/src/utils/Image.d.ts +0 -1
  37. package/dist/types/src/utils/Image.d.ts.map +1 -1
  38. package/package.json +5 -2
@@ -4,6 +4,39 @@
4
4
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Pillarbox = factory());
5
5
  })(this, (function () { 'use strict';
6
6
 
7
+ function asyncGeneratorStep(n, t, e, r, o, a, c) {
8
+ try {
9
+ var i = n[a](c),
10
+ u = i.value;
11
+ } catch (n) {
12
+ return void e(n);
13
+ }
14
+ i.done ? t(u) : Promise.resolve(u).then(r, o);
15
+ }
16
+ function _asyncToGenerator(n) {
17
+ return function () {
18
+ var t = this,
19
+ e = arguments;
20
+ return new Promise(function (r, o) {
21
+ var a = n.apply(t, e);
22
+ function _next(n) {
23
+ asyncGeneratorStep(a, r, o, _next, _throw, "next", n);
24
+ }
25
+ function _throw(n) {
26
+ asyncGeneratorStep(a, r, o, _next, _throw, "throw", n);
27
+ }
28
+ _next(void 0);
29
+ });
30
+ };
31
+ }
32
+ function _defineProperty(e, r, t) {
33
+ return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
34
+ value: t,
35
+ enumerable: true,
36
+ configurable: true,
37
+ writable: true
38
+ }) : e[r] = t, e;
39
+ }
7
40
  function ownKeys(e, r) {
8
41
  var t = Object.keys(e);
9
42
  if (Object.getOwnPropertySymbols) {
@@ -17,7 +50,7 @@
17
50
  function _objectSpread2(e) {
18
51
  for (var r = 1; r < arguments.length; r++) {
19
52
  var t = null != arguments[r] ? arguments[r] : {};
20
- r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
53
+ r % 2 ? ownKeys(Object(t), true).forEach(function (r) {
21
54
  _defineProperty(e, r, t[r]);
22
55
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
23
56
  Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
@@ -25,11 +58,31 @@
25
58
  }
26
59
  return e;
27
60
  }
61
+ function _objectWithoutProperties(e, t) {
62
+ if (null == e) return {};
63
+ var o,
64
+ r,
65
+ i = _objectWithoutPropertiesLoose(e, t);
66
+ if (Object.getOwnPropertySymbols) {
67
+ var n = Object.getOwnPropertySymbols(e);
68
+ for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
69
+ }
70
+ return i;
71
+ }
72
+ function _objectWithoutPropertiesLoose(r, e) {
73
+ if (null == r) return {};
74
+ var t = {};
75
+ for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
76
+ if (-1 !== e.indexOf(n)) continue;
77
+ t[n] = r[n];
78
+ }
79
+ return t;
80
+ }
28
81
  function _toPrimitive(t, r) {
29
82
  if ("object" != typeof t || !t) return t;
30
83
  var e = t[Symbol.toPrimitive];
31
84
  if (void 0 !== e) {
32
- var i = e.call(t, r || "default");
85
+ var i = e.call(t, r);
33
86
  if ("object" != typeof i) return i;
34
87
  throw new TypeError("@@toPrimitive must return a primitive value.");
35
88
  }
@@ -39,78 +92,8 @@
39
92
  var i = _toPrimitive(t, "string");
40
93
  return "symbol" == typeof i ? i : i + "";
41
94
  }
42
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
43
- try {
44
- var info = gen[key](arg);
45
- var value = info.value;
46
- } catch (error) {
47
- reject(error);
48
- return;
49
- }
50
- if (info.done) {
51
- resolve(value);
52
- } else {
53
- Promise.resolve(value).then(_next, _throw);
54
- }
55
- }
56
- function _asyncToGenerator(fn) {
57
- return function () {
58
- var self = this,
59
- args = arguments;
60
- return new Promise(function (resolve, reject) {
61
- var gen = fn.apply(self, args);
62
- function _next(value) {
63
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
64
- }
65
- function _throw(err) {
66
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
67
- }
68
- _next(undefined);
69
- });
70
- };
71
- }
72
- function _defineProperty(obj, key, value) {
73
- key = _toPropertyKey(key);
74
- if (key in obj) {
75
- Object.defineProperty(obj, key, {
76
- value: value,
77
- enumerable: true,
78
- configurable: true,
79
- writable: true
80
- });
81
- } else {
82
- obj[key] = value;
83
- }
84
- return obj;
85
- }
86
- function _objectWithoutPropertiesLoose(source, excluded) {
87
- if (source == null) return {};
88
- var target = {};
89
- for (var key in source) {
90
- if (Object.prototype.hasOwnProperty.call(source, key)) {
91
- if (excluded.indexOf(key) >= 0) continue;
92
- target[key] = source[key];
93
- }
94
- }
95
- return target;
96
- }
97
- function _objectWithoutProperties(source, excluded) {
98
- if (source == null) return {};
99
- var target = _objectWithoutPropertiesLoose(source, excluded);
100
- var key, i;
101
- if (Object.getOwnPropertySymbols) {
102
- var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
103
- for (i = 0; i < sourceSymbolKeys.length; i++) {
104
- key = sourceSymbolKeys[i];
105
- if (excluded.indexOf(key) >= 0) continue;
106
- if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
107
- target[key] = source[key];
108
- }
109
- }
110
- return target;
111
- }
112
95
 
113
- const version$8 = "1.21.0";
96
+ const version$8 = "1.21.2";
114
97
 
115
98
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
116
99
 
@@ -191,23 +174,18 @@
191
174
  var lib = {exports: {}};
192
175
 
193
176
  function _extends$2() {
194
- _extends$2 = Object.assign ? Object.assign.bind() : function (target) {
195
- for (var i = 1; i < arguments.length; i++) {
196
- var source = arguments[i];
197
- for (var key in source) {
198
- if (Object.prototype.hasOwnProperty.call(source, key)) {
199
- target[key] = source[key];
200
- }
201
- }
177
+ return _extends$2 = Object.assign ? Object.assign.bind() : function (n) {
178
+ for (var e = 1; e < arguments.length; e++) {
179
+ var t = arguments[e];
180
+ for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
202
181
  }
203
- return target;
204
- };
205
- return _extends$2.apply(this, arguments);
182
+ return n;
183
+ }, _extends$2.apply(null, arguments);
206
184
  }
207
185
 
208
186
  const _extends$3 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
209
187
  __proto__: null,
210
- default: _extends$2
188
+ get default () { return _extends$2; }
211
189
  }, Symbol.toStringTag, { value: 'Module' }));
212
190
 
213
191
  const require$$1 = /*@__PURE__*/getAugmentedNamespace(_extends$3);
@@ -10543,11 +10521,9 @@
10543
10521
 
10544
10522
  var errors = {
10545
10523
  INVALID_NUMBER_OF_PERIOD: 'INVALID_NUMBER_OF_PERIOD',
10546
- INVALID_NUMBER_OF_CONTENT_STEERING: 'INVALID_NUMBER_OF_CONTENT_STEERING',
10547
10524
  DASH_EMPTY_MANIFEST: 'DASH_EMPTY_MANIFEST',
10548
10525
  DASH_INVALID_XML: 'DASH_INVALID_XML',
10549
10526
  NO_BASE_URL: 'NO_BASE_URL',
10550
- MISSING_SEGMENT_INFORMATION: 'MISSING_SEGMENT_INFORMATION',
10551
10527
  SEGMENT_TIME_UNSPECIFIED: 'SEGMENT_TIME_UNSPECIFIED',
10552
10528
  UNSUPPORTED_UTC_TIMING_SCHEME: 'UNSUPPORTED_UTC_TIMING_SCHEME'
10553
10529
  };
@@ -13210,9 +13186,7 @@
13210
13186
  };
13211
13187
 
13212
13188
  var numbers = {
13213
- getUint64: getUint64$1,
13214
- MAX_UINT32: MAX_UINT32
13215
- };
13189
+ getUint64: getUint64$1};
13216
13190
 
13217
13191
  var getUint64 = numbers.getUint64;
13218
13192
 
@@ -13888,58 +13862,8 @@
13888
13862
  * Licensed Apache-2.0 https://github.com/videojs/mux.js/blob/master/LICENSE
13889
13863
  */
13890
13864
 
13891
- var
13892
- ONE_SECOND_IN_TS = 90000, // 90kHz clock
13893
- secondsToVideoTs,
13894
- secondsToAudioTs,
13895
- videoTsToSeconds,
13896
- audioTsToSeconds,
13897
- audioTsToVideoTs,
13898
- videoTsToAudioTs,
13899
- metadataTsToSeconds;
13900
-
13901
- secondsToVideoTs = function(seconds) {
13902
- return seconds * ONE_SECOND_IN_TS;
13903
- };
13904
-
13905
- secondsToAudioTs = function(seconds, sampleRate) {
13906
- return seconds * sampleRate;
13907
- };
13908
-
13909
- videoTsToSeconds = function(timestamp) {
13910
- return timestamp / ONE_SECOND_IN_TS;
13911
- };
13912
-
13913
- audioTsToSeconds = function(timestamp, sampleRate) {
13914
- return timestamp / sampleRate;
13915
- };
13916
-
13917
- audioTsToVideoTs = function(timestamp, sampleRate) {
13918
- return secondsToVideoTs(audioTsToSeconds(timestamp, sampleRate));
13919
- };
13920
-
13921
- videoTsToAudioTs = function(timestamp, sampleRate) {
13922
- return secondsToAudioTs(videoTsToSeconds(timestamp), sampleRate);
13923
- };
13924
-
13925
- /**
13926
- * Adjust ID3 tag or caption timing information by the timeline pts values
13927
- * (if keepOriginalTimestamps is false) and convert to seconds
13928
- */
13929
- metadataTsToSeconds = function(timestamp, timelineStartPts, keepOriginalTimestamps) {
13930
- return videoTsToSeconds(keepOriginalTimestamps ? timestamp : timestamp - timelineStartPts);
13931
- };
13932
-
13933
13865
  var clock = {
13934
- ONE_SECOND_IN_TS: ONE_SECOND_IN_TS,
13935
- secondsToVideoTs: secondsToVideoTs,
13936
- secondsToAudioTs: secondsToAudioTs,
13937
- videoTsToSeconds: videoTsToSeconds,
13938
- audioTsToSeconds: audioTsToSeconds,
13939
- audioTsToVideoTs: audioTsToVideoTs,
13940
- videoTsToAudioTs: videoTsToAudioTs,
13941
- metadataTsToSeconds: metadataTsToSeconds
13942
- };
13866
+ };
13943
13867
 
13944
13868
  /**
13945
13869
  * @license
@@ -49861,11 +49785,6 @@
49861
49785
  // Frames that allow different types of text encoding contain a text
49862
49786
  // encoding description byte [ID3v2.4.0 section 4.]
49863
49787
  textEncodingDescriptionByte = {
49864
- Iso88591: 0x00,
49865
- // ISO-8859-1, terminated with \0.
49866
- Utf16: 0x01,
49867
- // UTF-16 encoded Unicode BOM, terminated with \0\0
49868
- Utf16be: 0x02,
49869
49788
  // UTF-16BE encoded Unicode, without BOM, terminated with \0\0
49870
49789
  Utf8: 0x03 // UTF-8 encoded Unicode, terminated with \0
49871
49790
  },
@@ -51484,9 +51403,7 @@
51484
51403
  };
51485
51404
  H264Stream$1.prototype = new Stream$2();
51486
51405
  var h264 = {
51487
- H264Stream: H264Stream$1,
51488
- NalByteStream: NalByteStream
51489
- };
51406
+ H264Stream: H264Stream$1};
51490
51407
  /**
51491
51408
  * mux.js
51492
51409
  *
@@ -52120,8 +52037,6 @@
52120
52037
 
52121
52038
  this.getGopForFusion_ = function (nalUnit) {
52122
52039
  var halfSecond = 45000,
52123
- // Half-a-second in a 90khz clock
52124
- allowableOverlap = 10000,
52125
52040
  // About 3 frames @ 30fps
52126
52041
  nearestDistance = Infinity,
52127
52042
  dtsDistance,
@@ -52145,7 +52060,7 @@
52145
52060
  dtsDistance = nalUnit.dts - currentGop.dts - currentGop.duration; // Only consider GOPS that start before the nal unit and end within
52146
52061
  // a half-second of the nal unit
52147
52062
 
52148
- if (dtsDistance >= -allowableOverlap && dtsDistance <= halfSecond) {
52063
+ if (dtsDistance >= -1e4 && dtsDistance <= halfSecond) {
52149
52064
  // Always use the closest GOP we found if there is more than
52150
52065
  // one candidate
52151
52066
  if (!nearestGopObj || nearestDistance > dtsDistance) {
@@ -52702,14 +52617,7 @@
52702
52617
  };
52703
52618
  Transmuxer.prototype = new Stream();
52704
52619
  var transmuxer = {
52705
- Transmuxer: Transmuxer,
52706
- VideoSegmentStream: VideoSegmentStream,
52707
- AudioSegmentStream: AudioSegmentStream,
52708
- AUDIO_PROPERTIES: AUDIO_PROPERTIES,
52709
- VIDEO_PROPERTIES: VIDEO_PROPERTIES,
52710
- // exported for testing
52711
- generateSegmentTimingInfo: generateSegmentTimingInfo
52712
- };
52620
+ Transmuxer: Transmuxer};
52713
52621
  /**
52714
52622
  * mux.js
52715
52623
  *
@@ -52834,45 +52742,6 @@
52834
52742
  return result;
52835
52743
  };
52836
52744
  var parseTfhd$2 = tfhd;
52837
- var getUint64$3 = numbers.getUint64;
52838
- var parseSidx = function (data) {
52839
- var view = new DataView(data.buffer, data.byteOffset, data.byteLength),
52840
- result = {
52841
- version: data[0],
52842
- flags: new Uint8Array(data.subarray(1, 4)),
52843
- references: [],
52844
- referenceId: view.getUint32(4),
52845
- timescale: view.getUint32(8)
52846
- },
52847
- i = 12;
52848
- if (result.version === 0) {
52849
- result.earliestPresentationTime = view.getUint32(i);
52850
- result.firstOffset = view.getUint32(i + 4);
52851
- i += 8;
52852
- } else {
52853
- // read 64 bits
52854
- result.earliestPresentationTime = getUint64$3(data.subarray(i));
52855
- result.firstOffset = getUint64$3(data.subarray(i + 8));
52856
- i += 16;
52857
- }
52858
- i += 2; // reserved
52859
-
52860
- var referenceCount = view.getUint16(i);
52861
- i += 2; // start of references
52862
-
52863
- for (; referenceCount > 0; i += 12, referenceCount--) {
52864
- result.references.push({
52865
- referenceType: (data[i] & 0x80) >>> 7,
52866
- referencedSize: view.getUint32(i) & 0x7FFFFFFF,
52867
- subsegmentDuration: view.getUint32(i + 4),
52868
- startsWithSap: !!(data[i + 8] & 0x80),
52869
- sapType: (data[i + 8] & 0x70) >>> 4,
52870
- sapDeltaTime: view.getUint32(i + 8) & 0x0FFFFFFF
52871
- });
52872
- }
52873
- return result;
52874
- };
52875
- var parseSidx_1 = parseSidx;
52876
52745
  var parseSampleFlags$1 = function (flags) {
52877
52746
  return {
52878
52747
  isLeading: (flags[0] & 0x0c) >>> 2,
@@ -52967,707 +52836,13 @@
52967
52836
  return result;
52968
52837
  };
52969
52838
  var parseTrun$2 = trun;
52970
- /**
52971
- * mux.js
52972
- *
52973
- * Copyright (c) Brightcove
52974
- * Licensed Apache-2.0 https://github.com/videojs/mux.js/blob/master/LICENSE
52975
- *
52976
- * Parse the internal MP4 structure into an equivalent javascript
52977
- * object.
52978
- */
52979
-
52980
- var numberHelpers = numbers;
52981
- var getUint64$2 = numberHelpers.getUint64;
52982
- var inspectMp4,
52983
- textifyMp4,
52984
- parseMp4Date = function (seconds) {
52985
- return new Date(seconds * 1000 - 2082844800000);
52986
- },
52987
- parseType$2 = parseType_1,
52988
- findBox$4 = findBox_1,
52989
- nalParse = function (avcStream) {
52990
- var avcView = new DataView(avcStream.buffer, avcStream.byteOffset, avcStream.byteLength),
52991
- result = [],
52992
- i,
52993
- length;
52994
- for (i = 0; i + 4 < avcStream.length; i += length) {
52995
- length = avcView.getUint32(i);
52996
- i += 4; // bail if this doesn't appear to be an H264 stream
52997
-
52998
- if (length <= 0) {
52999
- result.push('<span style=\'color:red;\'>MALFORMED DATA</span>');
53000
- continue;
53001
- }
53002
- switch (avcStream[i] & 0x1F) {
53003
- case 0x01:
53004
- result.push('slice_layer_without_partitioning_rbsp');
53005
- break;
53006
- case 0x05:
53007
- result.push('slice_layer_without_partitioning_rbsp_idr');
53008
- break;
53009
- case 0x06:
53010
- result.push('sei_rbsp');
53011
- break;
53012
- case 0x07:
53013
- result.push('seq_parameter_set_rbsp');
53014
- break;
53015
- case 0x08:
53016
- result.push('pic_parameter_set_rbsp');
53017
- break;
53018
- case 0x09:
53019
- result.push('access_unit_delimiter_rbsp');
53020
- break;
53021
- default:
53022
- result.push('UNKNOWN NAL - ' + avcStream[i] & 0x1F);
53023
- break;
53024
- }
53025
- }
53026
- return result;
53027
- },
53028
- // registry of handlers for individual mp4 box types
52839
+ var // registry of handlers for individual mp4 box types
53029
52840
  parse = {
53030
- // codingname, not a first-class box type. stsd entries share the
53031
- // same format as real boxes so the parsing infrastructure can be
53032
- // shared
53033
- avc1: function (data) {
53034
- var view = new DataView(data.buffer, data.byteOffset, data.byteLength);
53035
- return {
53036
- dataReferenceIndex: view.getUint16(6),
53037
- width: view.getUint16(24),
53038
- height: view.getUint16(26),
53039
- horizresolution: view.getUint16(28) + view.getUint16(30) / 16,
53040
- vertresolution: view.getUint16(32) + view.getUint16(34) / 16,
53041
- frameCount: view.getUint16(40),
53042
- depth: view.getUint16(74),
53043
- config: inspectMp4(data.subarray(78, data.byteLength))
53044
- };
53045
- },
53046
- avcC: function (data) {
53047
- var view = new DataView(data.buffer, data.byteOffset, data.byteLength),
53048
- result = {
53049
- configurationVersion: data[0],
53050
- avcProfileIndication: data[1],
53051
- profileCompatibility: data[2],
53052
- avcLevelIndication: data[3],
53053
- lengthSizeMinusOne: data[4] & 0x03,
53054
- sps: [],
53055
- pps: []
53056
- },
53057
- numOfSequenceParameterSets = data[5] & 0x1f,
53058
- numOfPictureParameterSets,
53059
- nalSize,
53060
- offset,
53061
- i; // iterate past any SPSs
53062
-
53063
- offset = 6;
53064
- for (i = 0; i < numOfSequenceParameterSets; i++) {
53065
- nalSize = view.getUint16(offset);
53066
- offset += 2;
53067
- result.sps.push(new Uint8Array(data.subarray(offset, offset + nalSize)));
53068
- offset += nalSize;
53069
- } // iterate past any PPSs
53070
-
53071
- numOfPictureParameterSets = data[offset];
53072
- offset++;
53073
- for (i = 0; i < numOfPictureParameterSets; i++) {
53074
- nalSize = view.getUint16(offset);
53075
- offset += 2;
53076
- result.pps.push(new Uint8Array(data.subarray(offset, offset + nalSize)));
53077
- offset += nalSize;
53078
- }
53079
- return result;
53080
- },
53081
- btrt: function (data) {
53082
- var view = new DataView(data.buffer, data.byteOffset, data.byteLength);
53083
- return {
53084
- bufferSizeDB: view.getUint32(0),
53085
- maxBitrate: view.getUint32(4),
53086
- avgBitrate: view.getUint32(8)
53087
- };
53088
- },
53089
- edts: function edts(data) {
53090
- return {
53091
- boxes: inspectMp4(data)
53092
- };
53093
- },
53094
- elst: function elst(data) {
53095
- var view = new DataView(data.buffer, data.byteOffset, data.byteLength),
53096
- result = {
53097
- version: view.getUint8(0),
53098
- flags: new Uint8Array(data.subarray(1, 4)),
53099
- edits: []
53100
- },
53101
- entryCount = view.getUint32(4),
53102
- i;
53103
- for (i = 8; entryCount; entryCount--) {
53104
- if (result.version === 0) {
53105
- result.edits.push({
53106
- segmentDuration: view.getUint32(i),
53107
- mediaTime: view.getInt32(i + 4),
53108
- mediaRate: view.getUint16(i + 8) + view.getUint16(i + 10) / (256 * 256)
53109
- });
53110
- i += 12;
53111
- } else {
53112
- result.edits.push({
53113
- segmentDuration: getUint64$2(data.subarray(i)),
53114
- mediaTime: getUint64$2(data.subarray(i + 8)),
53115
- mediaRate: view.getUint16(i + 16) + view.getUint16(i + 18) / (256 * 256)
53116
- });
53117
- i += 20;
53118
- }
53119
- }
53120
- return result;
53121
- },
53122
- esds: function (data) {
53123
- return {
53124
- version: data[0],
53125
- flags: new Uint8Array(data.subarray(1, 4)),
53126
- esId: data[6] << 8 | data[7],
53127
- streamPriority: data[8] & 0x1f,
53128
- decoderConfig: {
53129
- objectProfileIndication: data[11],
53130
- streamType: data[12] >>> 2 & 0x3f,
53131
- bufferSize: data[13] << 16 | data[14] << 8 | data[15],
53132
- maxBitrate: data[16] << 24 | data[17] << 16 | data[18] << 8 | data[19],
53133
- avgBitrate: data[20] << 24 | data[21] << 16 | data[22] << 8 | data[23],
53134
- decoderConfigDescriptor: {
53135
- tag: data[24],
53136
- length: data[25],
53137
- audioObjectType: data[26] >>> 3 & 0x1f,
53138
- samplingFrequencyIndex: (data[26] & 0x07) << 1 | data[27] >>> 7 & 0x01,
53139
- channelConfiguration: data[27] >>> 3 & 0x0f
53140
- }
53141
- }
53142
- };
53143
- },
53144
- ftyp: function (data) {
53145
- var view = new DataView(data.buffer, data.byteOffset, data.byteLength),
53146
- result = {
53147
- majorBrand: parseType$2(data.subarray(0, 4)),
53148
- minorVersion: view.getUint32(4),
53149
- compatibleBrands: []
53150
- },
53151
- i = 8;
53152
- while (i < data.byteLength) {
53153
- result.compatibleBrands.push(parseType$2(data.subarray(i, i + 4)));
53154
- i += 4;
53155
- }
53156
- return result;
53157
- },
53158
- dinf: function (data) {
53159
- return {
53160
- boxes: inspectMp4(data)
53161
- };
53162
- },
53163
- dref: function (data) {
53164
- return {
53165
- version: data[0],
53166
- flags: new Uint8Array(data.subarray(1, 4)),
53167
- dataReferences: inspectMp4(data.subarray(8))
53168
- };
53169
- },
53170
- hdlr: function (data) {
53171
- var view = new DataView(data.buffer, data.byteOffset, data.byteLength),
53172
- result = {
53173
- version: view.getUint8(0),
53174
- flags: new Uint8Array(data.subarray(1, 4)),
53175
- handlerType: parseType$2(data.subarray(8, 12)),
53176
- name: ''
53177
- },
53178
- i = 8; // parse out the name field
53179
-
53180
- for (i = 24; i < data.byteLength; i++) {
53181
- if (data[i] === 0x00) {
53182
- // the name field is null-terminated
53183
- i++;
53184
- break;
53185
- }
53186
- result.name += String.fromCharCode(data[i]);
53187
- } // decode UTF-8 to javascript's internal representation
53188
- // see http://ecmanaut.blogspot.com/2006/07/encoding-decoding-utf8-in-javascript.html
53189
-
53190
- result.name = decodeURIComponent(escape(result.name));
53191
- return result;
53192
- },
53193
- mdat: function (data) {
53194
- return {
53195
- byteLength: data.byteLength,
53196
- nals: nalParse(data)
53197
- };
53198
- },
53199
- mdhd: function (data) {
53200
- var view = new DataView(data.buffer, data.byteOffset, data.byteLength),
53201
- i = 4,
53202
- language,
53203
- result = {
53204
- version: view.getUint8(0),
53205
- flags: new Uint8Array(data.subarray(1, 4)),
53206
- language: ''
53207
- };
53208
- if (result.version === 1) {
53209
- i += 4;
53210
- result.creationTime = parseMp4Date(view.getUint32(i)); // truncating top 4 bytes
53211
-
53212
- i += 8;
53213
- result.modificationTime = parseMp4Date(view.getUint32(i)); // truncating top 4 bytes
53214
-
53215
- i += 4;
53216
- result.timescale = view.getUint32(i);
53217
- i += 8;
53218
- result.duration = view.getUint32(i); // truncating top 4 bytes
53219
- } else {
53220
- result.creationTime = parseMp4Date(view.getUint32(i));
53221
- i += 4;
53222
- result.modificationTime = parseMp4Date(view.getUint32(i));
53223
- i += 4;
53224
- result.timescale = view.getUint32(i);
53225
- i += 4;
53226
- result.duration = view.getUint32(i);
53227
- }
53228
- i += 4; // language is stored as an ISO-639-2/T code in an array of three 5-bit fields
53229
- // each field is the packed difference between its ASCII value and 0x60
53230
-
53231
- language = view.getUint16(i);
53232
- result.language += String.fromCharCode((language >> 10) + 0x60);
53233
- result.language += String.fromCharCode(((language & 0x03e0) >> 5) + 0x60);
53234
- result.language += String.fromCharCode((language & 0x1f) + 0x60);
53235
- return result;
53236
- },
53237
- mdia: function (data) {
53238
- return {
53239
- boxes: inspectMp4(data)
53240
- };
53241
- },
53242
- mfhd: function (data) {
53243
- return {
53244
- version: data[0],
53245
- flags: new Uint8Array(data.subarray(1, 4)),
53246
- sequenceNumber: data[4] << 24 | data[5] << 16 | data[6] << 8 | data[7]
53247
- };
53248
- },
53249
- minf: function (data) {
53250
- return {
53251
- boxes: inspectMp4(data)
53252
- };
53253
- },
53254
- // codingname, not a first-class box type. stsd entries share the
53255
- // same format as real boxes so the parsing infrastructure can be
53256
- // shared
53257
- mp4a: function (data) {
53258
- var view = new DataView(data.buffer, data.byteOffset, data.byteLength),
53259
- result = {
53260
- // 6 bytes reserved
53261
- dataReferenceIndex: view.getUint16(6),
53262
- // 4 + 4 bytes reserved
53263
- channelcount: view.getUint16(16),
53264
- samplesize: view.getUint16(18),
53265
- // 2 bytes pre_defined
53266
- // 2 bytes reserved
53267
- samplerate: view.getUint16(24) + view.getUint16(26) / 65536
53268
- }; // if there are more bytes to process, assume this is an ISO/IEC
53269
- // 14496-14 MP4AudioSampleEntry and parse the ESDBox
53270
-
53271
- if (data.byteLength > 28) {
53272
- result.streamDescriptor = inspectMp4(data.subarray(28))[0];
53273
- }
53274
- return result;
53275
- },
53276
- moof: function (data) {
53277
- return {
53278
- boxes: inspectMp4(data)
53279
- };
53280
- },
53281
- moov: function (data) {
53282
- return {
53283
- boxes: inspectMp4(data)
53284
- };
53285
- },
53286
- mvex: function (data) {
53287
- return {
53288
- boxes: inspectMp4(data)
53289
- };
53290
- },
53291
- mvhd: function (data) {
53292
- var view = new DataView(data.buffer, data.byteOffset, data.byteLength),
53293
- i = 4,
53294
- result = {
53295
- version: view.getUint8(0),
53296
- flags: new Uint8Array(data.subarray(1, 4))
53297
- };
53298
- if (result.version === 1) {
53299
- i += 4;
53300
- result.creationTime = parseMp4Date(view.getUint32(i)); // truncating top 4 bytes
53301
-
53302
- i += 8;
53303
- result.modificationTime = parseMp4Date(view.getUint32(i)); // truncating top 4 bytes
53304
-
53305
- i += 4;
53306
- result.timescale = view.getUint32(i);
53307
- i += 8;
53308
- result.duration = view.getUint32(i); // truncating top 4 bytes
53309
- } else {
53310
- result.creationTime = parseMp4Date(view.getUint32(i));
53311
- i += 4;
53312
- result.modificationTime = parseMp4Date(view.getUint32(i));
53313
- i += 4;
53314
- result.timescale = view.getUint32(i);
53315
- i += 4;
53316
- result.duration = view.getUint32(i);
53317
- }
53318
- i += 4; // convert fixed-point, base 16 back to a number
53319
-
53320
- result.rate = view.getUint16(i) + view.getUint16(i + 2) / 16;
53321
- i += 4;
53322
- result.volume = view.getUint8(i) + view.getUint8(i + 1) / 8;
53323
- i += 2;
53324
- i += 2;
53325
- i += 2 * 4;
53326
- result.matrix = new Uint32Array(data.subarray(i, i + 9 * 4));
53327
- i += 9 * 4;
53328
- i += 6 * 4;
53329
- result.nextTrackId = view.getUint32(i);
53330
- return result;
53331
- },
53332
- pdin: function (data) {
53333
- var view = new DataView(data.buffer, data.byteOffset, data.byteLength);
53334
- return {
53335
- version: view.getUint8(0),
53336
- flags: new Uint8Array(data.subarray(1, 4)),
53337
- rate: view.getUint32(4),
53338
- initialDelay: view.getUint32(8)
53339
- };
53340
- },
53341
- sdtp: function (data) {
53342
- var result = {
53343
- version: data[0],
53344
- flags: new Uint8Array(data.subarray(1, 4)),
53345
- samples: []
53346
- },
53347
- i;
53348
- for (i = 4; i < data.byteLength; i++) {
53349
- result.samples.push({
53350
- dependsOn: (data[i] & 0x30) >> 4,
53351
- isDependedOn: (data[i] & 0x0c) >> 2,
53352
- hasRedundancy: data[i] & 0x03
53353
- });
53354
- }
53355
- return result;
53356
- },
53357
- sidx: parseSidx_1,
53358
- smhd: function (data) {
53359
- return {
53360
- version: data[0],
53361
- flags: new Uint8Array(data.subarray(1, 4)),
53362
- balance: data[4] + data[5] / 256
53363
- };
53364
- },
53365
- stbl: function (data) {
53366
- return {
53367
- boxes: inspectMp4(data)
53368
- };
53369
- },
53370
- ctts: function (data) {
53371
- var view = new DataView(data.buffer, data.byteOffset, data.byteLength),
53372
- result = {
53373
- version: view.getUint8(0),
53374
- flags: new Uint8Array(data.subarray(1, 4)),
53375
- compositionOffsets: []
53376
- },
53377
- entryCount = view.getUint32(4),
53378
- i;
53379
- for (i = 8; entryCount; i += 8, entryCount--) {
53380
- result.compositionOffsets.push({
53381
- sampleCount: view.getUint32(i),
53382
- sampleOffset: view[result.version === 0 ? 'getUint32' : 'getInt32'](i + 4)
53383
- });
53384
- }
53385
- return result;
53386
- },
53387
- stss: function (data) {
53388
- var view = new DataView(data.buffer, data.byteOffset, data.byteLength),
53389
- result = {
53390
- version: view.getUint8(0),
53391
- flags: new Uint8Array(data.subarray(1, 4)),
53392
- syncSamples: []
53393
- },
53394
- entryCount = view.getUint32(4),
53395
- i;
53396
- for (i = 8; entryCount; i += 4, entryCount--) {
53397
- result.syncSamples.push(view.getUint32(i));
53398
- }
53399
- return result;
53400
- },
53401
- stco: function (data) {
53402
- var view = new DataView(data.buffer, data.byteOffset, data.byteLength),
53403
- result = {
53404
- version: data[0],
53405
- flags: new Uint8Array(data.subarray(1, 4)),
53406
- chunkOffsets: []
53407
- },
53408
- entryCount = view.getUint32(4),
53409
- i;
53410
- for (i = 8; entryCount; i += 4, entryCount--) {
53411
- result.chunkOffsets.push(view.getUint32(i));
53412
- }
53413
- return result;
53414
- },
53415
- stsc: function (data) {
53416
- var view = new DataView(data.buffer, data.byteOffset, data.byteLength),
53417
- entryCount = view.getUint32(4),
53418
- result = {
53419
- version: data[0],
53420
- flags: new Uint8Array(data.subarray(1, 4)),
53421
- sampleToChunks: []
53422
- },
53423
- i;
53424
- for (i = 8; entryCount; i += 12, entryCount--) {
53425
- result.sampleToChunks.push({
53426
- firstChunk: view.getUint32(i),
53427
- samplesPerChunk: view.getUint32(i + 4),
53428
- sampleDescriptionIndex: view.getUint32(i + 8)
53429
- });
53430
- }
53431
- return result;
53432
- },
53433
- stsd: function (data) {
53434
- return {
53435
- version: data[0],
53436
- flags: new Uint8Array(data.subarray(1, 4)),
53437
- sampleDescriptions: inspectMp4(data.subarray(8))
53438
- };
53439
- },
53440
- stsz: function (data) {
53441
- var view = new DataView(data.buffer, data.byteOffset, data.byteLength),
53442
- result = {
53443
- version: data[0],
53444
- flags: new Uint8Array(data.subarray(1, 4)),
53445
- sampleSize: view.getUint32(4),
53446
- entries: []
53447
- },
53448
- i;
53449
- for (i = 12; i < data.byteLength; i += 4) {
53450
- result.entries.push(view.getUint32(i));
53451
- }
53452
- return result;
53453
- },
53454
- stts: function (data) {
53455
- var view = new DataView(data.buffer, data.byteOffset, data.byteLength),
53456
- result = {
53457
- version: data[0],
53458
- flags: new Uint8Array(data.subarray(1, 4)),
53459
- timeToSamples: []
53460
- },
53461
- entryCount = view.getUint32(4),
53462
- i;
53463
- for (i = 8; entryCount; i += 8, entryCount--) {
53464
- result.timeToSamples.push({
53465
- sampleCount: view.getUint32(i),
53466
- sampleDelta: view.getUint32(i + 4)
53467
- });
53468
- }
53469
- return result;
53470
- },
53471
- styp: function (data) {
53472
- return parse.ftyp(data);
53473
- },
53474
52841
  tfdt: parseTfdt$3,
53475
- tfhd: parseTfhd$2,
53476
- tkhd: function (data) {
53477
- var view = new DataView(data.buffer, data.byteOffset, data.byteLength),
53478
- i = 4,
53479
- result = {
53480
- version: view.getUint8(0),
53481
- flags: new Uint8Array(data.subarray(1, 4))
53482
- };
53483
- if (result.version === 1) {
53484
- i += 4;
53485
- result.creationTime = parseMp4Date(view.getUint32(i)); // truncating top 4 bytes
53486
-
53487
- i += 8;
53488
- result.modificationTime = parseMp4Date(view.getUint32(i)); // truncating top 4 bytes
53489
-
53490
- i += 4;
53491
- result.trackId = view.getUint32(i);
53492
- i += 4;
53493
- i += 8;
53494
- result.duration = view.getUint32(i); // truncating top 4 bytes
53495
- } else {
53496
- result.creationTime = parseMp4Date(view.getUint32(i));
53497
- i += 4;
53498
- result.modificationTime = parseMp4Date(view.getUint32(i));
53499
- i += 4;
53500
- result.trackId = view.getUint32(i);
53501
- i += 4;
53502
- i += 4;
53503
- result.duration = view.getUint32(i);
53504
- }
53505
- i += 4;
53506
- i += 2 * 4;
53507
- result.layer = view.getUint16(i);
53508
- i += 2;
53509
- result.alternateGroup = view.getUint16(i);
53510
- i += 2; // convert fixed-point, base 16 back to a number
53511
-
53512
- result.volume = view.getUint8(i) + view.getUint8(i + 1) / 8;
53513
- i += 2;
53514
- i += 2;
53515
- result.matrix = new Uint32Array(data.subarray(i, i + 9 * 4));
53516
- i += 9 * 4;
53517
- result.width = view.getUint16(i) + view.getUint16(i + 2) / 65536;
53518
- i += 4;
53519
- result.height = view.getUint16(i) + view.getUint16(i + 2) / 65536;
53520
- return result;
53521
- },
53522
- traf: function (data) {
53523
- return {
53524
- boxes: inspectMp4(data)
53525
- };
53526
- },
53527
- trak: function (data) {
53528
- return {
53529
- boxes: inspectMp4(data)
53530
- };
53531
- },
53532
- trex: function (data) {
53533
- var view = new DataView(data.buffer, data.byteOffset, data.byteLength);
53534
- return {
53535
- version: data[0],
53536
- flags: new Uint8Array(data.subarray(1, 4)),
53537
- trackId: view.getUint32(4),
53538
- defaultSampleDescriptionIndex: view.getUint32(8),
53539
- defaultSampleDuration: view.getUint32(12),
53540
- defaultSampleSize: view.getUint32(16),
53541
- sampleDependsOn: data[20] & 0x03,
53542
- sampleIsDependedOn: (data[21] & 0xc0) >> 6,
53543
- sampleHasRedundancy: (data[21] & 0x30) >> 4,
53544
- samplePaddingValue: (data[21] & 0x0e) >> 1,
53545
- sampleIsDifferenceSample: !!(data[21] & 0x01),
53546
- sampleDegradationPriority: view.getUint16(22)
53547
- };
53548
- },
53549
- trun: parseTrun$2,
53550
- 'url ': function (data) {
53551
- return {
53552
- version: data[0],
53553
- flags: new Uint8Array(data.subarray(1, 4))
53554
- };
53555
- },
53556
- vmhd: function (data) {
53557
- var view = new DataView(data.buffer, data.byteOffset, data.byteLength);
53558
- return {
53559
- version: data[0],
53560
- flags: new Uint8Array(data.subarray(1, 4)),
53561
- graphicsmode: view.getUint16(4),
53562
- opcolor: new Uint16Array([view.getUint16(6), view.getUint16(8), view.getUint16(10)])
53563
- };
53564
- }
53565
- };
53566
- /**
53567
- * Return a javascript array of box objects parsed from an ISO base
53568
- * media file.
53569
- * @param data {Uint8Array} the binary data of the media to be inspected
53570
- * @return {array} a javascript array of potentially nested box objects
53571
- */
53572
-
53573
- inspectMp4 = function (data) {
53574
- var i = 0,
53575
- result = [],
53576
- view,
53577
- size,
53578
- type,
53579
- end,
53580
- box; // Convert data from Uint8Array to ArrayBuffer, to follow Dataview API
53581
-
53582
- var ab = new ArrayBuffer(data.length);
53583
- var v = new Uint8Array(ab);
53584
- for (var z = 0; z < data.length; ++z) {
53585
- v[z] = data[z];
53586
- }
53587
- view = new DataView(ab);
53588
- while (i < data.byteLength) {
53589
- // parse box data
53590
- size = view.getUint32(i);
53591
- type = parseType$2(data.subarray(i + 4, i + 8));
53592
- end = size > 1 ? i + size : data.byteLength; // parse type-specific data
53593
-
53594
- box = (parse[type] || function (data) {
53595
- return {
53596
- data: data
53597
- };
53598
- })(data.subarray(i + 8, end));
53599
- box.size = size;
53600
- box.type = type; // store this box and move to the next
53601
-
53602
- result.push(box);
53603
- i = end;
53604
- }
53605
- return result;
53606
- };
53607
- /**
53608
- * Returns a textual representation of the javascript represtentation
53609
- * of an MP4 file. You can use it as an alternative to
53610
- * JSON.stringify() to compare inspected MP4s.
53611
- * @param inspectedMp4 {array} the parsed array of boxes in an MP4
53612
- * file
53613
- * @param depth {number} (optional) the number of ancestor boxes of
53614
- * the elements of inspectedMp4. Assumed to be zero if unspecified.
53615
- * @return {string} a text representation of the parsed MP4
53616
- */
53617
-
53618
- textifyMp4 = function (inspectedMp4, depth) {
53619
- var indent;
53620
- depth = depth || 0;
53621
- indent = new Array(depth * 2 + 1).join(' '); // iterate over all the boxes
53622
-
53623
- return inspectedMp4.map(function (box, index) {
53624
- // list the box type first at the current indentation level
53625
- return indent + box.type + '\n' +
53626
- // the type is already included and handle child boxes separately
53627
- Object.keys(box).filter(function (key) {
53628
- return key !== 'type' && key !== 'boxes'; // output all the box properties
53629
- }).map(function (key) {
53630
- var prefix = indent + ' ' + key + ': ',
53631
- value = box[key]; // print out raw bytes as hexademical
53632
-
53633
- if (value instanceof Uint8Array || value instanceof Uint32Array) {
53634
- var bytes = Array.prototype.slice.call(new Uint8Array(value.buffer, value.byteOffset, value.byteLength)).map(function (byte) {
53635
- return ' ' + ('00' + byte.toString(16)).slice(-2);
53636
- }).join('').match(/.{1,24}/g);
53637
- if (!bytes) {
53638
- return prefix + '<>';
53639
- }
53640
- if (bytes.length === 1) {
53641
- return prefix + '<' + bytes.join('').slice(1) + '>';
53642
- }
53643
- return prefix + '<\n' + bytes.map(function (line) {
53644
- return indent + ' ' + line;
53645
- }).join('\n') + '\n' + indent + ' >';
53646
- } // stringify generic objects
53647
-
53648
- return prefix + JSON.stringify(value, null, 2).split('\n').map(function (line, index) {
53649
- if (index === 0) {
53650
- return line;
53651
- }
53652
- return indent + ' ' + line;
53653
- }).join('\n');
53654
- }).join('\n') + (
53655
- // recursively textify the child boxes
53656
- box.boxes ? '\n' + textifyMp4(box.boxes, depth + 1) : '');
53657
- }).join('\n');
53658
- };
52842
+ trun: parseTrun$2};
53659
52843
  var mp4Inspector = {
53660
- inspect: inspectMp4,
53661
- textify: textifyMp4,
53662
- parseType: parseType$2,
53663
- findBox: findBox$4,
53664
- parseTraf: parse.traf,
53665
52844
  parseTfdt: parse.tfdt,
53666
- parseHdlr: parse.hdlr,
53667
- parseTfhd: parse.tfhd,
53668
- parseTrun: parse.trun,
53669
- parseSidx: parse.sidx
53670
- };
52845
+ parseTrun: parse.trun};
53671
52846
  /**
53672
52847
  * Returns the first string in the data array ending with a null char '\0'
53673
52848
  * @param {UInt8} data
@@ -75159,15 +74334,15 @@ ${segmentInfoString(segmentInfo)}`); // If there's an init segment associated wi
75159
74334
  *
75160
74335
  * @returns {Promise<Array.<MainResourceWithKeySystems>>}
75161
74336
  */
75162
- static composeAkamaiResources(resources = []) {
75163
- return _asyncToGenerator(function* () {
74337
+ static composeAkamaiResources() {
74338
+ return _asyncToGenerator(function* (resources = []) {
75164
74339
  if (!AkamaiTokenService.hasToken(resources)) {
75165
74340
  return Promise.resolve(resources);
75166
74341
  }
75167
74342
 
75168
74343
  // TODO allow to modify the Akamai URL
75169
74344
  return AkamaiTokenService.tokenizeSources(resources);
75170
- })();
74345
+ }).apply(this, arguments);
75171
74346
  }
75172
74347
 
75173
74348
  /**
@@ -75389,11 +74564,11 @@ ${segmentInfoString(segmentInfo)}`); // If there's an init segment associated wi
75389
74564
  *
75390
74565
  * @returns {Promise<MediaComposition>}
75391
74566
  */
75392
- static getMediaComposition(urn, handleRequest = new DataProvider().handleRequest()) {
75393
- return _asyncToGenerator(function* () {
74567
+ static getMediaComposition(_x) {
74568
+ return _asyncToGenerator(function* (urn, handleRequest = new DataProvider().handleRequest()) {
75394
74569
  const data = yield handleRequest(urn);
75395
74570
  return Object.assign(new MediaComposition(), data);
75396
- })();
74571
+ }).apply(this, arguments);
75397
74572
  }
75398
74573
 
75399
74574
  /**
@@ -75616,7 +74791,7 @@ ${segmentInfoString(segmentInfo)}`); // If there's an init segment associated wi
75616
74791
  var _ref = _asyncToGenerator(function* (srcObj, next) {
75617
74792
  return SrgSsr.handleSetSource(player, srcObj, next);
75618
74793
  });
75619
- return function setSource(_x, _x2) {
74794
+ return function setSource(_x2, _x3) {
75620
74795
  return _ref.apply(this, arguments);
75621
74796
  };
75622
74797
  }()