@vidispine/vdt-js 0.15.0-pre.8 → 21.4.0-pre.2
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/index.es.js +197 -111
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +199 -110
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -2,6 +2,44 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
function ownKeys(object, enumerableOnly) {
|
|
6
|
+
var keys = Object.keys(object);
|
|
7
|
+
|
|
8
|
+
if (Object.getOwnPropertySymbols) {
|
|
9
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
10
|
+
|
|
11
|
+
if (enumerableOnly) {
|
|
12
|
+
symbols = symbols.filter(function (sym) {
|
|
13
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
keys.push.apply(keys, symbols);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return keys;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function _objectSpread2(target) {
|
|
24
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
25
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
26
|
+
|
|
27
|
+
if (i % 2) {
|
|
28
|
+
ownKeys(Object(source), true).forEach(function (key) {
|
|
29
|
+
_defineProperty(target, key, source[key]);
|
|
30
|
+
});
|
|
31
|
+
} else if (Object.getOwnPropertyDescriptors) {
|
|
32
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
33
|
+
} else {
|
|
34
|
+
ownKeys(Object(source)).forEach(function (key) {
|
|
35
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return target;
|
|
41
|
+
}
|
|
42
|
+
|
|
5
43
|
function _typeof(obj) {
|
|
6
44
|
"@babel/helpers - typeof";
|
|
7
45
|
|
|
@@ -55,40 +93,6 @@ function _defineProperty(obj, key, value) {
|
|
|
55
93
|
return obj;
|
|
56
94
|
}
|
|
57
95
|
|
|
58
|
-
function ownKeys(object, enumerableOnly) {
|
|
59
|
-
var keys = Object.keys(object);
|
|
60
|
-
|
|
61
|
-
if (Object.getOwnPropertySymbols) {
|
|
62
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
63
|
-
if (enumerableOnly) symbols = symbols.filter(function (sym) {
|
|
64
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
65
|
-
});
|
|
66
|
-
keys.push.apply(keys, symbols);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
return keys;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
function _objectSpread2(target) {
|
|
73
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
74
|
-
var source = arguments[i] != null ? arguments[i] : {};
|
|
75
|
-
|
|
76
|
-
if (i % 2) {
|
|
77
|
-
ownKeys(Object(source), true).forEach(function (key) {
|
|
78
|
-
_defineProperty(target, key, source[key]);
|
|
79
|
-
});
|
|
80
|
-
} else if (Object.getOwnPropertyDescriptors) {
|
|
81
|
-
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
82
|
-
} else {
|
|
83
|
-
ownKeys(Object(source)).forEach(function (key) {
|
|
84
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
return target;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
96
|
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
93
97
|
if (source == null) return {};
|
|
94
98
|
var target = {};
|
|
@@ -142,18 +146,21 @@ function _arrayWithHoles(arr) {
|
|
|
142
146
|
}
|
|
143
147
|
|
|
144
148
|
function _iterableToArray(iter) {
|
|
145
|
-
if (typeof Symbol !== "undefined" && Symbol.iterator
|
|
149
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
146
150
|
}
|
|
147
151
|
|
|
148
152
|
function _iterableToArrayLimit(arr, i) {
|
|
149
|
-
|
|
153
|
+
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
154
|
+
|
|
155
|
+
if (_i == null) return;
|
|
150
156
|
var _arr = [];
|
|
151
157
|
var _n = true;
|
|
152
158
|
var _d = false;
|
|
153
|
-
|
|
159
|
+
|
|
160
|
+
var _s, _e;
|
|
154
161
|
|
|
155
162
|
try {
|
|
156
|
-
for (
|
|
163
|
+
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
|
|
157
164
|
_arr.push(_s.value);
|
|
158
165
|
|
|
159
166
|
if (i && _arr.length === i) break;
|
|
@@ -197,6 +204,11 @@ function _nonIterableRest() {
|
|
|
197
204
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
198
205
|
}
|
|
199
206
|
|
|
207
|
+
var _excluded = ["value"],
|
|
208
|
+
_excluded2 = ["field", "group"],
|
|
209
|
+
_excluded3 = ["field", "group"],
|
|
210
|
+
_excluded4 = ["timespan"];
|
|
211
|
+
|
|
200
212
|
var sortTimespanList = function sortTimespanList(_ref, _ref2) {
|
|
201
213
|
var firstStart = _ref.start;
|
|
202
214
|
var secondStart = _ref2.start;
|
|
@@ -263,7 +275,7 @@ var parseField = function parseField() {
|
|
|
263
275
|
|
|
264
276
|
var _field$value = field.value,
|
|
265
277
|
value = _field$value === void 0 ? [] : _field$value,
|
|
266
|
-
attributes = _objectWithoutProperties(field,
|
|
278
|
+
attributes = _objectWithoutProperties(field, _excluded);
|
|
267
279
|
|
|
268
280
|
var parsedValueList = parseValueList(value, options);
|
|
269
281
|
if (includeAttributes || includeFieldAttributes) return _objectSpread2(_objectSpread2({}, attributes), {}, {
|
|
@@ -333,7 +345,7 @@ var parseGroup = function parseGroup() {
|
|
|
333
345
|
fieldList = _group$field === void 0 ? [] : _group$field,
|
|
334
346
|
_group$group = group.group,
|
|
335
347
|
groupList = _group$group === void 0 ? [] : _group$group,
|
|
336
|
-
attributes = _objectWithoutProperties(group,
|
|
348
|
+
attributes = _objectWithoutProperties(group, _excluded2);
|
|
337
349
|
|
|
338
350
|
var parsedFieldList = parseFieldList(fieldList, options);
|
|
339
351
|
var parsedGroupList = parseGroupList(groupList, options); // eslint-disable-line no-use-before-define,max-len
|
|
@@ -417,7 +429,7 @@ var parseTimespan = function parseTimespan() {
|
|
|
417
429
|
fieldList = _timespan$field === void 0 ? [] : _timespan$field,
|
|
418
430
|
_timespan$group = timespan.group,
|
|
419
431
|
groupList = _timespan$group === void 0 ? [] : _timespan$group,
|
|
420
|
-
attributes = _objectWithoutProperties(timespan,
|
|
432
|
+
attributes = _objectWithoutProperties(timespan, _excluded3);
|
|
421
433
|
|
|
422
434
|
var field = parseFieldList(fieldList, options);
|
|
423
435
|
var group = parseGroupList(groupList, options);
|
|
@@ -522,7 +534,7 @@ var parseMetadataType = function parseMetadataType() {
|
|
|
522
534
|
|
|
523
535
|
var _metadataType$timespa2 = metadataType.timespan,
|
|
524
536
|
timespanList = _metadataType$timespa2 === void 0 ? [] : _metadataType$timespa2,
|
|
525
|
-
attributes = _objectWithoutProperties(metadataType,
|
|
537
|
+
attributes = _objectWithoutProperties(metadataType, _excluded4);
|
|
526
538
|
|
|
527
539
|
if (sortTimespan) timespanList.sort(sortTimespanList);
|
|
528
540
|
var timespan = parseTimespanList(timespanList, options);
|
|
@@ -534,20 +546,24 @@ var parseMetadataType = function parseMetadataType() {
|
|
|
534
546
|
return timespan;
|
|
535
547
|
};
|
|
536
548
|
|
|
549
|
+
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
550
|
+
|
|
537
551
|
function createCommonjsModule(fn, module) {
|
|
538
552
|
return module = { exports: {} }, fn(module, module.exports), module.exports;
|
|
539
553
|
}
|
|
540
554
|
|
|
541
555
|
var filesize = createCommonjsModule(function (module, exports) {
|
|
542
|
-
/**
|
|
543
|
-
* filesize
|
|
544
|
-
*
|
|
545
|
-
* @copyright
|
|
546
|
-
* @license BSD-3-Clause
|
|
547
|
-
* @version 6.
|
|
556
|
+
/**
|
|
557
|
+
* filesize
|
|
558
|
+
*
|
|
559
|
+
* @copyright 2021 Jason Mulligan <jason.mulligan@avoidwork.com>
|
|
560
|
+
* @license BSD-3-Clause
|
|
561
|
+
* @version 6.4.0
|
|
548
562
|
*/
|
|
563
|
+
(function (global, factory) {
|
|
564
|
+
module.exports = factory() ;
|
|
565
|
+
})(commonjsGlobal, function () {
|
|
549
566
|
|
|
550
|
-
(function (global) {
|
|
551
567
|
var b = /^(b|B)$/,
|
|
552
568
|
symbol = {
|
|
553
569
|
iec: {
|
|
@@ -562,37 +578,45 @@ var filesize = createCommonjsModule(function (module, exports) {
|
|
|
562
578
|
fullform = {
|
|
563
579
|
iec: ["", "kibi", "mebi", "gibi", "tebi", "pebi", "exbi", "zebi", "yobi"],
|
|
564
580
|
jedec: ["", "kilo", "mega", "giga", "tera", "peta", "exa", "zetta", "yotta"]
|
|
581
|
+
},
|
|
582
|
+
roundingFuncs = {
|
|
583
|
+
floor: Math.floor,
|
|
584
|
+
ceil: Math.ceil
|
|
565
585
|
};
|
|
566
|
-
/**
|
|
567
|
-
* filesize
|
|
568
|
-
*
|
|
569
|
-
* @method filesize
|
|
570
|
-
* @param {Mixed} arg String, Int or Float to transform
|
|
571
|
-
* @param {Object} descriptor [Optional] Flags
|
|
572
|
-
* @return {String} Readable file size String
|
|
586
|
+
/**
|
|
587
|
+
* filesize
|
|
588
|
+
*
|
|
589
|
+
* @method filesize
|
|
590
|
+
* @param {Mixed} arg String, Int or Float to transform
|
|
591
|
+
* @param {Object} descriptor [Optional] Flags
|
|
592
|
+
* @return {String} Readable file size String
|
|
573
593
|
*/
|
|
574
594
|
|
|
575
595
|
function filesize(arg) {
|
|
576
596
|
var descriptor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
577
597
|
var result = [],
|
|
578
598
|
val = 0,
|
|
579
|
-
e
|
|
580
|
-
base
|
|
581
|
-
bits
|
|
582
|
-
ceil
|
|
583
|
-
full
|
|
584
|
-
fullforms
|
|
585
|
-
locale
|
|
586
|
-
localeOptions
|
|
587
|
-
neg
|
|
588
|
-
num
|
|
589
|
-
output
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
599
|
+
e,
|
|
600
|
+
base,
|
|
601
|
+
bits,
|
|
602
|
+
ceil,
|
|
603
|
+
full,
|
|
604
|
+
fullforms,
|
|
605
|
+
locale,
|
|
606
|
+
localeOptions,
|
|
607
|
+
neg,
|
|
608
|
+
num,
|
|
609
|
+
output,
|
|
610
|
+
pad,
|
|
611
|
+
round,
|
|
612
|
+
u,
|
|
613
|
+
unix,
|
|
614
|
+
separator,
|
|
615
|
+
spacer,
|
|
616
|
+
standard,
|
|
617
|
+
symbols,
|
|
618
|
+
roundingFunc,
|
|
619
|
+
precision;
|
|
596
620
|
|
|
597
621
|
if (isNaN(arg)) {
|
|
598
622
|
throw new TypeError("Invalid number");
|
|
@@ -600,6 +624,7 @@ var filesize = createCommonjsModule(function (module, exports) {
|
|
|
600
624
|
|
|
601
625
|
bits = descriptor.bits === true;
|
|
602
626
|
unix = descriptor.unix === true;
|
|
627
|
+
pad = descriptor.pad === true;
|
|
603
628
|
base = descriptor.base || 2;
|
|
604
629
|
round = descriptor.round !== void 0 ? descriptor.round : unix ? 1 : 2;
|
|
605
630
|
locale = descriptor.locale !== void 0 ? descriptor.locale : "";
|
|
@@ -612,9 +637,11 @@ var filesize = createCommonjsModule(function (module, exports) {
|
|
|
612
637
|
full = descriptor.fullform === true;
|
|
613
638
|
fullforms = descriptor.fullforms instanceof Array ? descriptor.fullforms : [];
|
|
614
639
|
e = descriptor.exponent !== void 0 ? descriptor.exponent : -1;
|
|
640
|
+
roundingFunc = roundingFuncs[descriptor.roundingMethod] || Math.round;
|
|
615
641
|
num = Number(arg);
|
|
616
642
|
neg = num < 0;
|
|
617
|
-
ceil = base > 2 ? 1000 : 1024;
|
|
643
|
+
ceil = base > 2 ? 1000 : 1024;
|
|
644
|
+
precision = isNaN(descriptor.precision) === false ? parseInt(descriptor.precision, 10) : 0; // Flipping a negative number to determine the size
|
|
618
645
|
|
|
619
646
|
if (neg) {
|
|
620
647
|
num = -num;
|
|
@@ -631,6 +658,10 @@ var filesize = createCommonjsModule(function (module, exports) {
|
|
|
631
658
|
|
|
632
659
|
|
|
633
660
|
if (e > 8) {
|
|
661
|
+
if (precision > 0) {
|
|
662
|
+
precision += 8 - e;
|
|
663
|
+
}
|
|
664
|
+
|
|
634
665
|
e = 8;
|
|
635
666
|
}
|
|
636
667
|
|
|
@@ -641,7 +672,7 @@ var filesize = createCommonjsModule(function (module, exports) {
|
|
|
641
672
|
|
|
642
673
|
if (num === 0) {
|
|
643
674
|
result[0] = 0;
|
|
644
|
-
result[1] = unix ? "" : symbol[standard][bits ? "bits" : "bytes"][e];
|
|
675
|
+
u = result[1] = unix ? "" : symbol[standard][bits ? "bits" : "bytes"][e];
|
|
645
676
|
} else {
|
|
646
677
|
val = num / (base === 2 ? Math.pow(2, e * 10) : Math.pow(1000, e));
|
|
647
678
|
|
|
@@ -654,14 +685,15 @@ var filesize = createCommonjsModule(function (module, exports) {
|
|
|
654
685
|
}
|
|
655
686
|
}
|
|
656
687
|
|
|
657
|
-
|
|
688
|
+
var p = Math.pow(10, e > 0 ? round : 0);
|
|
689
|
+
result[0] = roundingFunc(val * p) / p;
|
|
658
690
|
|
|
659
691
|
if (result[0] === ceil && e < 8 && descriptor.exponent === void 0) {
|
|
660
692
|
result[0] = 1;
|
|
661
693
|
e++;
|
|
662
694
|
}
|
|
663
695
|
|
|
664
|
-
result[1] = base === 10 && e === 1 ? bits ? "kb" : "kB" : symbol[standard][bits ? "bits" : "bytes"][e];
|
|
696
|
+
u = result[1] = base === 10 && e === 1 ? bits ? "kb" : "kB" : symbol[standard][bits ? "bits" : "bytes"][e];
|
|
665
697
|
|
|
666
698
|
if (unix) {
|
|
667
699
|
result[1] = standard === "jedec" ? result[1].charAt(0) : e > 0 ? result[1].replace(/B$/, "") : result[1];
|
|
@@ -676,6 +708,11 @@ var filesize = createCommonjsModule(function (module, exports) {
|
|
|
676
708
|
|
|
677
709
|
if (neg) {
|
|
678
710
|
result[0] = -result[0];
|
|
711
|
+
} // Setting optional precision
|
|
712
|
+
|
|
713
|
+
|
|
714
|
+
if (precision > 0) {
|
|
715
|
+
result[0] = result[0].toPrecision(precision);
|
|
679
716
|
} // Applying custom symbol
|
|
680
717
|
|
|
681
718
|
|
|
@@ -687,26 +724,28 @@ var filesize = createCommonjsModule(function (module, exports) {
|
|
|
687
724
|
result[0] = result[0].toLocaleString(locale, localeOptions);
|
|
688
725
|
} else if (separator.length > 0) {
|
|
689
726
|
result[0] = result[0].toString().replace(".", separator);
|
|
690
|
-
}
|
|
691
|
-
|
|
727
|
+
}
|
|
692
728
|
|
|
693
|
-
if (
|
|
694
|
-
|
|
729
|
+
if (pad && Number.isInteger(result[0]) === false && round > 0) {
|
|
730
|
+
var x = separator || ".",
|
|
731
|
+
tmp = result[0].toString().split(x),
|
|
732
|
+
s = tmp[1] || "",
|
|
733
|
+
l = s.length,
|
|
734
|
+
n = round - l;
|
|
735
|
+
result[0] = "".concat(tmp[0]).concat(x).concat(s.padEnd(l + n, "0"));
|
|
695
736
|
}
|
|
696
737
|
|
|
697
738
|
if (full) {
|
|
698
739
|
result[1] = fullforms[e] ? fullforms[e] : fullform[standard][e] + (bits ? "bit" : "byte") + (result[0] === 1 ? "" : "s");
|
|
699
|
-
}
|
|
740
|
+
} // Returning Array, Object, or String (default)
|
|
700
741
|
|
|
701
|
-
if (output === "object") {
|
|
702
|
-
return {
|
|
703
|
-
value: result[0],
|
|
704
|
-
symbol: result[1],
|
|
705
|
-
exponent: e
|
|
706
|
-
};
|
|
707
|
-
}
|
|
708
742
|
|
|
709
|
-
return result
|
|
743
|
+
return output === "array" ? result : output === "object" ? {
|
|
744
|
+
value: result[0],
|
|
745
|
+
symbol: result[1],
|
|
746
|
+
exponent: e,
|
|
747
|
+
unit: u
|
|
748
|
+
} : result.join(spacer);
|
|
710
749
|
} // Partial application for functional programming
|
|
711
750
|
|
|
712
751
|
|
|
@@ -714,13 +753,10 @@ var filesize = createCommonjsModule(function (module, exports) {
|
|
|
714
753
|
return function (arg) {
|
|
715
754
|
return filesize(arg, opt);
|
|
716
755
|
};
|
|
717
|
-
};
|
|
718
|
-
|
|
756
|
+
};
|
|
719
757
|
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
}
|
|
723
|
-
})();
|
|
758
|
+
return filesize;
|
|
759
|
+
});
|
|
724
760
|
});
|
|
725
761
|
|
|
726
762
|
var _CONSTANT_TIMEBASES;
|
|
@@ -737,6 +773,12 @@ var CONSTANT_TIMEBASES = (_CONSTANT_TIMEBASES = {}, _defineProperty(_CONSTANT_TI
|
|
|
737
773
|
}), _defineProperty(_CONSTANT_TIMEBASES, NTSC30, {
|
|
738
774
|
denominator: 30,
|
|
739
775
|
numerator: 1
|
|
776
|
+
}), _defineProperty(_CONSTANT_TIMEBASES, 29.97, {
|
|
777
|
+
denominator: 30000,
|
|
778
|
+
numerator: 1001
|
|
779
|
+
}), _defineProperty(_CONSTANT_TIMEBASES, 59.94, {
|
|
780
|
+
denominator: 60000,
|
|
781
|
+
numerator: 1001
|
|
740
782
|
}), _CONSTANT_TIMEBASES);
|
|
741
783
|
var FRAME_SEPARATORS = {
|
|
742
784
|
':': {
|
|
@@ -846,8 +888,8 @@ var TimeBase = /*#__PURE__*/function () {
|
|
|
846
888
|
|
|
847
889
|
_classCallCheck(this, TimeBase);
|
|
848
890
|
|
|
849
|
-
this.numerator = numerator;
|
|
850
|
-
this.denominator = denominator;
|
|
891
|
+
this.numerator = Number(numerator);
|
|
892
|
+
this.denominator = Number(denominator);
|
|
851
893
|
}
|
|
852
894
|
|
|
853
895
|
_createClass(TimeBase, [{
|
|
@@ -1121,6 +1163,11 @@ var TimeCode = /*#__PURE__*/function () {
|
|
|
1121
1163
|
|
|
1122
1164
|
return [hhmmss, frames.toFixed().padStart(2, '0')].join(frameSeparator);
|
|
1123
1165
|
}
|
|
1166
|
+
}, {
|
|
1167
|
+
key: "toFraction",
|
|
1168
|
+
value: function toFraction() {
|
|
1169
|
+
return "".concat(this.samples, "@").concat(this.timeBase.denominator, ":").concat(this.timeBase.numerator);
|
|
1170
|
+
}
|
|
1124
1171
|
}]);
|
|
1125
1172
|
|
|
1126
1173
|
return TimeCode;
|
|
@@ -1160,7 +1207,7 @@ var formatTimeBaseText = function formatTimeBaseText(timeBaseText) {
|
|
|
1160
1207
|
var denominator = Number(timeBaseText);
|
|
1161
1208
|
|
|
1162
1209
|
if (Number.isNaN(denominator)) {
|
|
1163
|
-
throw new Error("timeBaseText must be a number or
|
|
1210
|
+
throw new Error("timeBaseText must be a number or ".concat(Object.keys(CONSTANT_TIMEBASES).join(','), " - is ").concat(timeBaseText));
|
|
1164
1211
|
}
|
|
1165
1212
|
|
|
1166
1213
|
return formatTimeBaseType({
|
|
@@ -1348,6 +1395,7 @@ var parseKeyValuePairType = function parseKeyValuePairType() {
|
|
|
1348
1395
|
return keyValuePairType.reduce(keyValuePairTypeReducer, {});
|
|
1349
1396
|
};
|
|
1350
1397
|
|
|
1398
|
+
var _excluded$1 = ["property"];
|
|
1351
1399
|
var sampleRateSymbols = {
|
|
1352
1400
|
kB: 'kHz',
|
|
1353
1401
|
B: 'Hz',
|
|
@@ -1382,7 +1430,7 @@ var parseBaseMediaInfoType = function parseBaseMediaInfoType() {
|
|
|
1382
1430
|
var baseMediaInfoType = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1383
1431
|
|
|
1384
1432
|
var keyValuePairType = baseMediaInfoType.property,
|
|
1385
|
-
props = _objectWithoutProperties(baseMediaInfoType,
|
|
1433
|
+
props = _objectWithoutProperties(baseMediaInfoType, _excluded$1);
|
|
1386
1434
|
|
|
1387
1435
|
var parsedKeyValuePairType = parseKeyValuePairType(keyValuePairType);
|
|
1388
1436
|
return _objectSpread2(_objectSpread2({}, parsedKeyValuePairType), props);
|
|
@@ -1393,7 +1441,8 @@ var parseFileType = function parseFileType(fileType) {
|
|
|
1393
1441
|
uriList = _fileType$uri === void 0 ? [] : _fileType$uri,
|
|
1394
1442
|
fileSizeBytes = fileType.size,
|
|
1395
1443
|
hash = fileType.hash,
|
|
1396
|
-
path = fileType.path
|
|
1444
|
+
path = fileType.path,
|
|
1445
|
+
fileId = fileType.id;
|
|
1397
1446
|
|
|
1398
1447
|
var _uriList = _slicedToArray(uriList, 1),
|
|
1399
1448
|
uri = _uriList[0];
|
|
@@ -1406,7 +1455,8 @@ var parseFileType = function parseFileType(fileType) {
|
|
|
1406
1455
|
fileSize: fileSize,
|
|
1407
1456
|
fileSizeBytes: fileSizeBytes,
|
|
1408
1457
|
path: path,
|
|
1409
|
-
fileName: fileName
|
|
1458
|
+
fileName: fileName,
|
|
1459
|
+
fileId: fileId
|
|
1410
1460
|
};
|
|
1411
1461
|
};
|
|
1412
1462
|
|
|
@@ -1679,6 +1729,9 @@ var parseShapeType = function parseShapeType() {
|
|
|
1679
1729
|
return parsedShape;
|
|
1680
1730
|
};
|
|
1681
1731
|
|
|
1732
|
+
var _excluded$2 = ["Codec"],
|
|
1733
|
+
_excluded2$1 = ["Codec"];
|
|
1734
|
+
|
|
1682
1735
|
var parseMediaConvertPreset = function parseMediaConvertPreset(transcodePresetType) {
|
|
1683
1736
|
var output = {};
|
|
1684
1737
|
var description = transcodePresetType.description,
|
|
@@ -1705,7 +1758,7 @@ var parseMediaConvertPreset = function parseMediaConvertPreset(transcodePresetTy
|
|
|
1705
1758
|
CodecSettings = _VideoDescription$Cod === void 0 ? {} : _VideoDescription$Cod;
|
|
1706
1759
|
|
|
1707
1760
|
var Codec = CodecSettings.Codec,
|
|
1708
|
-
otherSettings = _objectWithoutProperties(CodecSettings,
|
|
1761
|
+
otherSettings = _objectWithoutProperties(CodecSettings, _excluded$2);
|
|
1709
1762
|
|
|
1710
1763
|
output.videoFormat = Codec;
|
|
1711
1764
|
var height = VideoDescription.Height,
|
|
@@ -1746,7 +1799,7 @@ var parseMediaConvertPreset = function parseMediaConvertPreset(transcodePresetTy
|
|
|
1746
1799
|
_CodecSettings = _AudioDescriptions$0$ === void 0 ? {} : _AudioDescriptions$0$;
|
|
1747
1800
|
|
|
1748
1801
|
var _Codec = _CodecSettings.Codec,
|
|
1749
|
-
_otherSettings = _objectWithoutProperties(_CodecSettings,
|
|
1802
|
+
_otherSettings = _objectWithoutProperties(_CodecSettings, _excluded2$1);
|
|
1750
1803
|
|
|
1751
1804
|
output.audioFormat = _Codec;
|
|
1752
1805
|
|
|
@@ -1887,6 +1940,9 @@ var createFacetType = function createFacetType() {
|
|
|
1887
1940
|
});
|
|
1888
1941
|
}; // eslint-disable-next-line import/prefer-default-export
|
|
1889
1942
|
|
|
1943
|
+
var _excluded$3 = ["groupName"],
|
|
1944
|
+
_excluded2$2 = ["start", "end"];
|
|
1945
|
+
|
|
1890
1946
|
/* eslint-disable import/prefer-default-export */
|
|
1891
1947
|
var parseValueList$1 = function parseValueList(value) {
|
|
1892
1948
|
if (value === undefined) return [];
|
|
@@ -1895,10 +1951,15 @@ var parseValueList$1 = function parseValueList(value) {
|
|
|
1895
1951
|
}];
|
|
1896
1952
|
|
|
1897
1953
|
if (Array.isArray(value)) {
|
|
1898
|
-
|
|
1899
|
-
|
|
1954
|
+
return value.map(function (valueOrObject) {
|
|
1955
|
+
if (_typeof(valueOrObject) === 'object') {
|
|
1956
|
+
return _objectSpread2({
|
|
1957
|
+
value: valueOrObject.value || ''
|
|
1958
|
+
}, valueOrObject);
|
|
1959
|
+
}
|
|
1960
|
+
|
|
1900
1961
|
return {
|
|
1901
|
-
value:
|
|
1962
|
+
value: valueOrObject
|
|
1902
1963
|
};
|
|
1903
1964
|
});
|
|
1904
1965
|
}
|
|
@@ -1979,7 +2040,7 @@ var parseGroupsOrFields = function parseGroupsOrFields(groupsOrFields) {
|
|
|
1979
2040
|
} else if (Array.isArray(value)) {
|
|
1980
2041
|
value.forEach(function (_ref4) {
|
|
1981
2042
|
var groupName = _ref4.groupName,
|
|
1982
|
-
groupValue = _objectWithoutProperties(_ref4,
|
|
2043
|
+
groupValue = _objectWithoutProperties(_ref4, _excluded$3);
|
|
1983
2044
|
|
|
1984
2045
|
// eslint-disable-next-line no-use-before-define
|
|
1985
2046
|
group.push(parseGroup$1({
|
|
@@ -2006,7 +2067,7 @@ var parseTimeSpan = function parseTimeSpan(timeSpan) {
|
|
|
2006
2067
|
start = _timeSpan$start === void 0 ? '-INF' : _timeSpan$start,
|
|
2007
2068
|
_timeSpan$end = timeSpan.end,
|
|
2008
2069
|
end = _timeSpan$end === void 0 ? '+INF' : _timeSpan$end,
|
|
2009
|
-
groupsOrFields = _objectWithoutProperties(timeSpan,
|
|
2070
|
+
groupsOrFields = _objectWithoutProperties(timeSpan, _excluded2$2);
|
|
2010
2071
|
|
|
2011
2072
|
var _parseGroupsOrFields2 = parseGroupsOrFields(groupsOrFields),
|
|
2012
2073
|
group = _parseGroupsOrFields2.group,
|
|
@@ -2097,6 +2158,7 @@ var DEFAULT_ALLOWED_MIME_TYPES = [].concat(VIDEO_MIME_TYPES, IMAGE_MIME_TYPES, A
|
|
|
2097
2158
|
var DEFAULT_ALLOWED_METHODS = ['http', 'https'];
|
|
2098
2159
|
var MP4_MIMETYPE = 'video/mp4';
|
|
2099
2160
|
var QUICKTIME_MIMETYPE = 'video/quicktime';
|
|
2161
|
+
var M4V_MIMETYPE = 'video/x-m4v';
|
|
2100
2162
|
var MP4_CONTAINER = 'MPEG-4';
|
|
2101
2163
|
var MOV_CONTAINER = 'mov';
|
|
2102
2164
|
var H264_CODEC = 'h264'; // Sort by tags in the order of previewShapeOrder, secondary alphabetical.
|
|
@@ -2143,7 +2205,7 @@ var filterShapeSource = function filterShapeSource() {
|
|
|
2143
2205
|
|
|
2144
2206
|
if (mimeType) {
|
|
2145
2207
|
type = mimeType;
|
|
2146
|
-
if (mimeType === QUICKTIME_MIMETYPE && (containerFormat === MP4_CONTAINER || containerFormat === MOV_CONTAINER) && videoCodec === H264_CODEC) type = MP4_MIMETYPE;
|
|
2208
|
+
if ((mimeType === QUICKTIME_MIMETYPE || mimeType === M4V_MIMETYPE) && (containerFormat === MP4_CONTAINER || containerFormat === MOV_CONTAINER) && videoCodec === H264_CODEC) type = MP4_MIMETYPE;
|
|
2147
2209
|
}
|
|
2148
2210
|
|
|
2149
2211
|
if (uri) {
|
|
@@ -2173,6 +2235,7 @@ var filterShapeSource = function filterShapeSource() {
|
|
|
2173
2235
|
var IMAGE = 'IMAGE';
|
|
2174
2236
|
var AUDIO = 'AUDIO';
|
|
2175
2237
|
var VIDEO = 'VIDEO';
|
|
2238
|
+
var DOCUMENT = 'DOCUMENT';
|
|
2176
2239
|
|
|
2177
2240
|
var getShapeMediaType = function getShapeMediaType() {
|
|
2178
2241
|
var shape = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
@@ -2191,6 +2254,11 @@ var getShapeMediaType = function getShapeMediaType() {
|
|
|
2191
2254
|
}
|
|
2192
2255
|
|
|
2193
2256
|
if (mimeType.startsWith('image/')) return IMAGE;
|
|
2257
|
+
if (mimeType.endsWith('/pdf')) return DOCUMENT;
|
|
2258
|
+
if (mimeType.startsWith('text/')) return DOCUMENT;
|
|
2259
|
+
if (mimeType.endsWith('/msword')) return DOCUMENT;
|
|
2260
|
+
if (mimeType.endsWith('/json')) return DOCUMENT;
|
|
2261
|
+
if (mimeType.endsWith('/xml')) return DOCUMENT;
|
|
2194
2262
|
return undefined;
|
|
2195
2263
|
};
|
|
2196
2264
|
|
|
@@ -2509,6 +2577,26 @@ var parseHighlightTimespanList = function parseHighlightTimespanList() {
|
|
|
2509
2577
|
}, {});
|
|
2510
2578
|
};
|
|
2511
2579
|
|
|
2580
|
+
var PDF = 'PDF';
|
|
2581
|
+
var TEXT = 'TEXT';
|
|
2582
|
+
var MSWORD = 'MSWORD';
|
|
2583
|
+
var JSON$1 = 'JSON';
|
|
2584
|
+
var XML = 'XML';
|
|
2585
|
+
|
|
2586
|
+
var getDocumentType = function getDocumentType() {
|
|
2587
|
+
var shape = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
2588
|
+
var mimeType = shape.mimeType;
|
|
2589
|
+
if (!mimeType) return undefined;
|
|
2590
|
+
if (mimeType.endsWith('/pdf')) return PDF;
|
|
2591
|
+
if (mimeType.startsWith('text/')) return TEXT;
|
|
2592
|
+
if (mimeType.endsWith('/msword')) return MSWORD;
|
|
2593
|
+
if (mimeType.endsWith('/json')) return JSON$1;
|
|
2594
|
+
if (mimeType.endsWith('/xml')) return XML;
|
|
2595
|
+
return undefined;
|
|
2596
|
+
};
|
|
2597
|
+
|
|
2598
|
+
exports.TimeBase = TimeBase;
|
|
2599
|
+
exports.TimeCode = TimeCode;
|
|
2512
2600
|
exports.createFacetType = createFacetType;
|
|
2513
2601
|
exports.createMetadataType = createMetadataType;
|
|
2514
2602
|
exports.filterShapeSource = filterShapeSource;
|
|
@@ -2522,6 +2610,7 @@ exports.formatTimeBaseText = formatTimeBaseText;
|
|
|
2522
2610
|
exports.formatTimeBaseType = formatTimeBaseType;
|
|
2523
2611
|
exports.formatTimeCodeText = formatTimeCodeText;
|
|
2524
2612
|
exports.formatTimeCodeType = formatTimeCodeType;
|
|
2613
|
+
exports.getDocumentType = getDocumentType;
|
|
2525
2614
|
exports.getShapeMediaType = getShapeMediaType;
|
|
2526
2615
|
exports.metadataTypeToWebVtt = metadataTypeToWebVtt;
|
|
2527
2616
|
exports.parseAspectRatio = parseAspectRatio;
|