@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 CHANGED
@@ -1,3 +1,41 @@
1
+ function ownKeys(object, enumerableOnly) {
2
+ var keys = Object.keys(object);
3
+
4
+ if (Object.getOwnPropertySymbols) {
5
+ var symbols = Object.getOwnPropertySymbols(object);
6
+
7
+ if (enumerableOnly) {
8
+ symbols = symbols.filter(function (sym) {
9
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
10
+ });
11
+ }
12
+
13
+ keys.push.apply(keys, symbols);
14
+ }
15
+
16
+ return keys;
17
+ }
18
+
19
+ function _objectSpread2(target) {
20
+ for (var i = 1; i < arguments.length; i++) {
21
+ var source = arguments[i] != null ? arguments[i] : {};
22
+
23
+ if (i % 2) {
24
+ ownKeys(Object(source), true).forEach(function (key) {
25
+ _defineProperty(target, key, source[key]);
26
+ });
27
+ } else if (Object.getOwnPropertyDescriptors) {
28
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
29
+ } else {
30
+ ownKeys(Object(source)).forEach(function (key) {
31
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
32
+ });
33
+ }
34
+ }
35
+
36
+ return target;
37
+ }
38
+
1
39
  function _typeof(obj) {
2
40
  "@babel/helpers - typeof";
3
41
 
@@ -51,40 +89,6 @@ function _defineProperty(obj, key, value) {
51
89
  return obj;
52
90
  }
53
91
 
54
- function ownKeys(object, enumerableOnly) {
55
- var keys = Object.keys(object);
56
-
57
- if (Object.getOwnPropertySymbols) {
58
- var symbols = Object.getOwnPropertySymbols(object);
59
- if (enumerableOnly) symbols = symbols.filter(function (sym) {
60
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
61
- });
62
- keys.push.apply(keys, symbols);
63
- }
64
-
65
- return keys;
66
- }
67
-
68
- function _objectSpread2(target) {
69
- for (var i = 1; i < arguments.length; i++) {
70
- var source = arguments[i] != null ? arguments[i] : {};
71
-
72
- if (i % 2) {
73
- ownKeys(Object(source), true).forEach(function (key) {
74
- _defineProperty(target, key, source[key]);
75
- });
76
- } else if (Object.getOwnPropertyDescriptors) {
77
- Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
78
- } else {
79
- ownKeys(Object(source)).forEach(function (key) {
80
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
81
- });
82
- }
83
- }
84
-
85
- return target;
86
- }
87
-
88
92
  function _objectWithoutPropertiesLoose(source, excluded) {
89
93
  if (source == null) return {};
90
94
  var target = {};
@@ -138,18 +142,21 @@ function _arrayWithHoles(arr) {
138
142
  }
139
143
 
140
144
  function _iterableToArray(iter) {
141
- if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
145
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
142
146
  }
143
147
 
144
148
  function _iterableToArrayLimit(arr, i) {
145
- if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;
149
+ var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
150
+
151
+ if (_i == null) return;
146
152
  var _arr = [];
147
153
  var _n = true;
148
154
  var _d = false;
149
- var _e = undefined;
155
+
156
+ var _s, _e;
150
157
 
151
158
  try {
152
- for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
159
+ for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
153
160
  _arr.push(_s.value);
154
161
 
155
162
  if (i && _arr.length === i) break;
@@ -193,6 +200,11 @@ function _nonIterableRest() {
193
200
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
194
201
  }
195
202
 
203
+ var _excluded = ["value"],
204
+ _excluded2 = ["field", "group"],
205
+ _excluded3 = ["field", "group"],
206
+ _excluded4 = ["timespan"];
207
+
196
208
  var sortTimespanList = function sortTimespanList(_ref, _ref2) {
197
209
  var firstStart = _ref.start;
198
210
  var secondStart = _ref2.start;
@@ -259,7 +271,7 @@ var parseField = function parseField() {
259
271
 
260
272
  var _field$value = field.value,
261
273
  value = _field$value === void 0 ? [] : _field$value,
262
- attributes = _objectWithoutProperties(field, ["value"]);
274
+ attributes = _objectWithoutProperties(field, _excluded);
263
275
 
264
276
  var parsedValueList = parseValueList(value, options);
265
277
  if (includeAttributes || includeFieldAttributes) return _objectSpread2(_objectSpread2({}, attributes), {}, {
@@ -329,7 +341,7 @@ var parseGroup = function parseGroup() {
329
341
  fieldList = _group$field === void 0 ? [] : _group$field,
330
342
  _group$group = group.group,
331
343
  groupList = _group$group === void 0 ? [] : _group$group,
332
- attributes = _objectWithoutProperties(group, ["field", "group"]);
344
+ attributes = _objectWithoutProperties(group, _excluded2);
333
345
 
334
346
  var parsedFieldList = parseFieldList(fieldList, options);
335
347
  var parsedGroupList = parseGroupList(groupList, options); // eslint-disable-line no-use-before-define,max-len
@@ -413,7 +425,7 @@ var parseTimespan = function parseTimespan() {
413
425
  fieldList = _timespan$field === void 0 ? [] : _timespan$field,
414
426
  _timespan$group = timespan.group,
415
427
  groupList = _timespan$group === void 0 ? [] : _timespan$group,
416
- attributes = _objectWithoutProperties(timespan, ["field", "group"]);
428
+ attributes = _objectWithoutProperties(timespan, _excluded3);
417
429
 
418
430
  var field = parseFieldList(fieldList, options);
419
431
  var group = parseGroupList(groupList, options);
@@ -518,7 +530,7 @@ var parseMetadataType = function parseMetadataType() {
518
530
 
519
531
  var _metadataType$timespa2 = metadataType.timespan,
520
532
  timespanList = _metadataType$timespa2 === void 0 ? [] : _metadataType$timespa2,
521
- attributes = _objectWithoutProperties(metadataType, ["timespan"]);
533
+ attributes = _objectWithoutProperties(metadataType, _excluded4);
522
534
 
523
535
  if (sortTimespan) timespanList.sort(sortTimespanList);
524
536
  var timespan = parseTimespanList(timespanList, options);
@@ -530,20 +542,24 @@ var parseMetadataType = function parseMetadataType() {
530
542
  return timespan;
531
543
  };
532
544
 
545
+ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
546
+
533
547
  function createCommonjsModule(fn, module) {
534
548
  return module = { exports: {} }, fn(module, module.exports), module.exports;
535
549
  }
536
550
 
537
551
  var filesize = createCommonjsModule(function (module, exports) {
538
- /**
539
- * filesize
540
- *
541
- * @copyright 2020 Jason Mulligan <jason.mulligan@avoidwork.com>
542
- * @license BSD-3-Clause
543
- * @version 6.1.0
552
+ /**
553
+ * filesize
554
+ *
555
+ * @copyright 2021 Jason Mulligan <jason.mulligan@avoidwork.com>
556
+ * @license BSD-3-Clause
557
+ * @version 6.4.0
544
558
  */
559
+ (function (global, factory) {
560
+ module.exports = factory() ;
561
+ })(commonjsGlobal, function () {
545
562
 
546
- (function (global) {
547
563
  var b = /^(b|B)$/,
548
564
  symbol = {
549
565
  iec: {
@@ -558,37 +574,45 @@ var filesize = createCommonjsModule(function (module, exports) {
558
574
  fullform = {
559
575
  iec: ["", "kibi", "mebi", "gibi", "tebi", "pebi", "exbi", "zebi", "yobi"],
560
576
  jedec: ["", "kilo", "mega", "giga", "tera", "peta", "exa", "zetta", "yotta"]
577
+ },
578
+ roundingFuncs = {
579
+ floor: Math.floor,
580
+ ceil: Math.ceil
561
581
  };
562
- /**
563
- * filesize
564
- *
565
- * @method filesize
566
- * @param {Mixed} arg String, Int or Float to transform
567
- * @param {Object} descriptor [Optional] Flags
568
- * @return {String} Readable file size String
582
+ /**
583
+ * filesize
584
+ *
585
+ * @method filesize
586
+ * @param {Mixed} arg String, Int or Float to transform
587
+ * @param {Object} descriptor [Optional] Flags
588
+ * @return {String} Readable file size String
569
589
  */
570
590
 
571
591
  function filesize(arg) {
572
592
  var descriptor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
573
593
  var result = [],
574
594
  val = 0,
575
- e = void 0,
576
- base = void 0,
577
- bits = void 0,
578
- ceil = void 0,
579
- full = void 0,
580
- fullforms = void 0,
581
- locale = void 0,
582
- localeOptions = void 0,
583
- neg = void 0,
584
- num = void 0,
585
- output = void 0,
586
- round = void 0,
587
- unix = void 0,
588
- separator = void 0,
589
- spacer = void 0,
590
- standard = void 0,
591
- symbols = void 0;
595
+ e,
596
+ base,
597
+ bits,
598
+ ceil,
599
+ full,
600
+ fullforms,
601
+ locale,
602
+ localeOptions,
603
+ neg,
604
+ num,
605
+ output,
606
+ pad,
607
+ round,
608
+ u,
609
+ unix,
610
+ separator,
611
+ spacer,
612
+ standard,
613
+ symbols,
614
+ roundingFunc,
615
+ precision;
592
616
 
593
617
  if (isNaN(arg)) {
594
618
  throw new TypeError("Invalid number");
@@ -596,6 +620,7 @@ var filesize = createCommonjsModule(function (module, exports) {
596
620
 
597
621
  bits = descriptor.bits === true;
598
622
  unix = descriptor.unix === true;
623
+ pad = descriptor.pad === true;
599
624
  base = descriptor.base || 2;
600
625
  round = descriptor.round !== void 0 ? descriptor.round : unix ? 1 : 2;
601
626
  locale = descriptor.locale !== void 0 ? descriptor.locale : "";
@@ -608,9 +633,11 @@ var filesize = createCommonjsModule(function (module, exports) {
608
633
  full = descriptor.fullform === true;
609
634
  fullforms = descriptor.fullforms instanceof Array ? descriptor.fullforms : [];
610
635
  e = descriptor.exponent !== void 0 ? descriptor.exponent : -1;
636
+ roundingFunc = roundingFuncs[descriptor.roundingMethod] || Math.round;
611
637
  num = Number(arg);
612
638
  neg = num < 0;
613
- ceil = base > 2 ? 1000 : 1024; // Flipping a negative number to determine the size
639
+ ceil = base > 2 ? 1000 : 1024;
640
+ precision = isNaN(descriptor.precision) === false ? parseInt(descriptor.precision, 10) : 0; // Flipping a negative number to determine the size
614
641
 
615
642
  if (neg) {
616
643
  num = -num;
@@ -627,6 +654,10 @@ var filesize = createCommonjsModule(function (module, exports) {
627
654
 
628
655
 
629
656
  if (e > 8) {
657
+ if (precision > 0) {
658
+ precision += 8 - e;
659
+ }
660
+
630
661
  e = 8;
631
662
  }
632
663
 
@@ -637,7 +668,7 @@ var filesize = createCommonjsModule(function (module, exports) {
637
668
 
638
669
  if (num === 0) {
639
670
  result[0] = 0;
640
- result[1] = unix ? "" : symbol[standard][bits ? "bits" : "bytes"][e];
671
+ u = result[1] = unix ? "" : symbol[standard][bits ? "bits" : "bytes"][e];
641
672
  } else {
642
673
  val = num / (base === 2 ? Math.pow(2, e * 10) : Math.pow(1000, e));
643
674
 
@@ -650,14 +681,15 @@ var filesize = createCommonjsModule(function (module, exports) {
650
681
  }
651
682
  }
652
683
 
653
- result[0] = Number(val.toFixed(e > 0 ? round : 0));
684
+ var p = Math.pow(10, e > 0 ? round : 0);
685
+ result[0] = roundingFunc(val * p) / p;
654
686
 
655
687
  if (result[0] === ceil && e < 8 && descriptor.exponent === void 0) {
656
688
  result[0] = 1;
657
689
  e++;
658
690
  }
659
691
 
660
- result[1] = base === 10 && e === 1 ? bits ? "kb" : "kB" : symbol[standard][bits ? "bits" : "bytes"][e];
692
+ u = result[1] = base === 10 && e === 1 ? bits ? "kb" : "kB" : symbol[standard][bits ? "bits" : "bytes"][e];
661
693
 
662
694
  if (unix) {
663
695
  result[1] = standard === "jedec" ? result[1].charAt(0) : e > 0 ? result[1].replace(/B$/, "") : result[1];
@@ -672,6 +704,11 @@ var filesize = createCommonjsModule(function (module, exports) {
672
704
 
673
705
  if (neg) {
674
706
  result[0] = -result[0];
707
+ } // Setting optional precision
708
+
709
+
710
+ if (precision > 0) {
711
+ result[0] = result[0].toPrecision(precision);
675
712
  } // Applying custom symbol
676
713
 
677
714
 
@@ -683,26 +720,28 @@ var filesize = createCommonjsModule(function (module, exports) {
683
720
  result[0] = result[0].toLocaleString(locale, localeOptions);
684
721
  } else if (separator.length > 0) {
685
722
  result[0] = result[0].toString().replace(".", separator);
686
- } // Returning Array, Object, or String (default)
687
-
723
+ }
688
724
 
689
- if (output === "array") {
690
- return result;
725
+ if (pad && Number.isInteger(result[0]) === false && round > 0) {
726
+ var x = separator || ".",
727
+ tmp = result[0].toString().split(x),
728
+ s = tmp[1] || "",
729
+ l = s.length,
730
+ n = round - l;
731
+ result[0] = "".concat(tmp[0]).concat(x).concat(s.padEnd(l + n, "0"));
691
732
  }
692
733
 
693
734
  if (full) {
694
735
  result[1] = fullforms[e] ? fullforms[e] : fullform[standard][e] + (bits ? "bit" : "byte") + (result[0] === 1 ? "" : "s");
695
- }
736
+ } // Returning Array, Object, or String (default)
696
737
 
697
- if (output === "object") {
698
- return {
699
- value: result[0],
700
- symbol: result[1],
701
- exponent: e
702
- };
703
- }
704
738
 
705
- return result.join(spacer);
739
+ return output === "array" ? result : output === "object" ? {
740
+ value: result[0],
741
+ symbol: result[1],
742
+ exponent: e,
743
+ unit: u
744
+ } : result.join(spacer);
706
745
  } // Partial application for functional programming
707
746
 
708
747
 
@@ -710,13 +749,10 @@ var filesize = createCommonjsModule(function (module, exports) {
710
749
  return function (arg) {
711
750
  return filesize(arg, opt);
712
751
  };
713
- }; // CommonJS, AMD, script tag
714
-
752
+ };
715
753
 
716
- {
717
- module.exports = filesize;
718
- }
719
- })();
754
+ return filesize;
755
+ });
720
756
  });
721
757
 
722
758
  var _CONSTANT_TIMEBASES;
@@ -733,6 +769,12 @@ var CONSTANT_TIMEBASES = (_CONSTANT_TIMEBASES = {}, _defineProperty(_CONSTANT_TI
733
769
  }), _defineProperty(_CONSTANT_TIMEBASES, NTSC30, {
734
770
  denominator: 30,
735
771
  numerator: 1
772
+ }), _defineProperty(_CONSTANT_TIMEBASES, 29.97, {
773
+ denominator: 30000,
774
+ numerator: 1001
775
+ }), _defineProperty(_CONSTANT_TIMEBASES, 59.94, {
776
+ denominator: 60000,
777
+ numerator: 1001
736
778
  }), _CONSTANT_TIMEBASES);
737
779
  var FRAME_SEPARATORS = {
738
780
  ':': {
@@ -842,8 +884,8 @@ var TimeBase = /*#__PURE__*/function () {
842
884
 
843
885
  _classCallCheck(this, TimeBase);
844
886
 
845
- this.numerator = numerator;
846
- this.denominator = denominator;
887
+ this.numerator = Number(numerator);
888
+ this.denominator = Number(denominator);
847
889
  }
848
890
 
849
891
  _createClass(TimeBase, [{
@@ -1117,6 +1159,11 @@ var TimeCode = /*#__PURE__*/function () {
1117
1159
 
1118
1160
  return [hhmmss, frames.toFixed().padStart(2, '0')].join(frameSeparator);
1119
1161
  }
1162
+ }, {
1163
+ key: "toFraction",
1164
+ value: function toFraction() {
1165
+ return "".concat(this.samples, "@").concat(this.timeBase.denominator, ":").concat(this.timeBase.numerator);
1166
+ }
1120
1167
  }]);
1121
1168
 
1122
1169
  return TimeCode;
@@ -1156,7 +1203,7 @@ var formatTimeBaseText = function formatTimeBaseText(timeBaseText) {
1156
1203
  var denominator = Number(timeBaseText);
1157
1204
 
1158
1205
  if (Number.isNaN(denominator)) {
1159
- throw new Error("timeBaseText must be a number or PAL,NTSC,NTSC30 - is ".concat(timeBaseText));
1206
+ throw new Error("timeBaseText must be a number or ".concat(Object.keys(CONSTANT_TIMEBASES).join(','), " - is ").concat(timeBaseText));
1160
1207
  }
1161
1208
 
1162
1209
  return formatTimeBaseType({
@@ -1344,6 +1391,7 @@ var parseKeyValuePairType = function parseKeyValuePairType() {
1344
1391
  return keyValuePairType.reduce(keyValuePairTypeReducer, {});
1345
1392
  };
1346
1393
 
1394
+ var _excluded$1 = ["property"];
1347
1395
  var sampleRateSymbols = {
1348
1396
  kB: 'kHz',
1349
1397
  B: 'Hz',
@@ -1378,7 +1426,7 @@ var parseBaseMediaInfoType = function parseBaseMediaInfoType() {
1378
1426
  var baseMediaInfoType = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1379
1427
 
1380
1428
  var keyValuePairType = baseMediaInfoType.property,
1381
- props = _objectWithoutProperties(baseMediaInfoType, ["property"]);
1429
+ props = _objectWithoutProperties(baseMediaInfoType, _excluded$1);
1382
1430
 
1383
1431
  var parsedKeyValuePairType = parseKeyValuePairType(keyValuePairType);
1384
1432
  return _objectSpread2(_objectSpread2({}, parsedKeyValuePairType), props);
@@ -1389,7 +1437,8 @@ var parseFileType = function parseFileType(fileType) {
1389
1437
  uriList = _fileType$uri === void 0 ? [] : _fileType$uri,
1390
1438
  fileSizeBytes = fileType.size,
1391
1439
  hash = fileType.hash,
1392
- path = fileType.path;
1440
+ path = fileType.path,
1441
+ fileId = fileType.id;
1393
1442
 
1394
1443
  var _uriList = _slicedToArray(uriList, 1),
1395
1444
  uri = _uriList[0];
@@ -1402,7 +1451,8 @@ var parseFileType = function parseFileType(fileType) {
1402
1451
  fileSize: fileSize,
1403
1452
  fileSizeBytes: fileSizeBytes,
1404
1453
  path: path,
1405
- fileName: fileName
1454
+ fileName: fileName,
1455
+ fileId: fileId
1406
1456
  };
1407
1457
  };
1408
1458
 
@@ -1675,6 +1725,9 @@ var parseShapeType = function parseShapeType() {
1675
1725
  return parsedShape;
1676
1726
  };
1677
1727
 
1728
+ var _excluded$2 = ["Codec"],
1729
+ _excluded2$1 = ["Codec"];
1730
+
1678
1731
  var parseMediaConvertPreset = function parseMediaConvertPreset(transcodePresetType) {
1679
1732
  var output = {};
1680
1733
  var description = transcodePresetType.description,
@@ -1701,7 +1754,7 @@ var parseMediaConvertPreset = function parseMediaConvertPreset(transcodePresetTy
1701
1754
  CodecSettings = _VideoDescription$Cod === void 0 ? {} : _VideoDescription$Cod;
1702
1755
 
1703
1756
  var Codec = CodecSettings.Codec,
1704
- otherSettings = _objectWithoutProperties(CodecSettings, ["Codec"]);
1757
+ otherSettings = _objectWithoutProperties(CodecSettings, _excluded$2);
1705
1758
 
1706
1759
  output.videoFormat = Codec;
1707
1760
  var height = VideoDescription.Height,
@@ -1742,7 +1795,7 @@ var parseMediaConvertPreset = function parseMediaConvertPreset(transcodePresetTy
1742
1795
  _CodecSettings = _AudioDescriptions$0$ === void 0 ? {} : _AudioDescriptions$0$;
1743
1796
 
1744
1797
  var _Codec = _CodecSettings.Codec,
1745
- _otherSettings = _objectWithoutProperties(_CodecSettings, ["Codec"]);
1798
+ _otherSettings = _objectWithoutProperties(_CodecSettings, _excluded2$1);
1746
1799
 
1747
1800
  output.audioFormat = _Codec;
1748
1801
 
@@ -1883,6 +1936,9 @@ var createFacetType = function createFacetType() {
1883
1936
  });
1884
1937
  }; // eslint-disable-next-line import/prefer-default-export
1885
1938
 
1939
+ var _excluded$3 = ["groupName"],
1940
+ _excluded2$2 = ["start", "end"];
1941
+
1886
1942
  /* eslint-disable import/prefer-default-export */
1887
1943
  var parseValueList$1 = function parseValueList(value) {
1888
1944
  if (value === undefined) return [];
@@ -1891,10 +1947,15 @@ var parseValueList$1 = function parseValueList(value) {
1891
1947
  }];
1892
1948
 
1893
1949
  if (Array.isArray(value)) {
1894
- if (value.length > 0 && value[0].value) return value;
1895
- return value.map(function (thisValue) {
1950
+ return value.map(function (valueOrObject) {
1951
+ if (_typeof(valueOrObject) === 'object') {
1952
+ return _objectSpread2({
1953
+ value: valueOrObject.value || ''
1954
+ }, valueOrObject);
1955
+ }
1956
+
1896
1957
  return {
1897
- value: thisValue
1958
+ value: valueOrObject
1898
1959
  };
1899
1960
  });
1900
1961
  }
@@ -1975,7 +2036,7 @@ var parseGroupsOrFields = function parseGroupsOrFields(groupsOrFields) {
1975
2036
  } else if (Array.isArray(value)) {
1976
2037
  value.forEach(function (_ref4) {
1977
2038
  var groupName = _ref4.groupName,
1978
- groupValue = _objectWithoutProperties(_ref4, ["groupName"]);
2039
+ groupValue = _objectWithoutProperties(_ref4, _excluded$3);
1979
2040
 
1980
2041
  // eslint-disable-next-line no-use-before-define
1981
2042
  group.push(parseGroup$1({
@@ -2002,7 +2063,7 @@ var parseTimeSpan = function parseTimeSpan(timeSpan) {
2002
2063
  start = _timeSpan$start === void 0 ? '-INF' : _timeSpan$start,
2003
2064
  _timeSpan$end = timeSpan.end,
2004
2065
  end = _timeSpan$end === void 0 ? '+INF' : _timeSpan$end,
2005
- groupsOrFields = _objectWithoutProperties(timeSpan, ["start", "end"]);
2066
+ groupsOrFields = _objectWithoutProperties(timeSpan, _excluded2$2);
2006
2067
 
2007
2068
  var _parseGroupsOrFields2 = parseGroupsOrFields(groupsOrFields),
2008
2069
  group = _parseGroupsOrFields2.group,
@@ -2093,6 +2154,7 @@ var DEFAULT_ALLOWED_MIME_TYPES = [].concat(VIDEO_MIME_TYPES, IMAGE_MIME_TYPES, A
2093
2154
  var DEFAULT_ALLOWED_METHODS = ['http', 'https'];
2094
2155
  var MP4_MIMETYPE = 'video/mp4';
2095
2156
  var QUICKTIME_MIMETYPE = 'video/quicktime';
2157
+ var M4V_MIMETYPE = 'video/x-m4v';
2096
2158
  var MP4_CONTAINER = 'MPEG-4';
2097
2159
  var MOV_CONTAINER = 'mov';
2098
2160
  var H264_CODEC = 'h264'; // Sort by tags in the order of previewShapeOrder, secondary alphabetical.
@@ -2139,7 +2201,7 @@ var filterShapeSource = function filterShapeSource() {
2139
2201
 
2140
2202
  if (mimeType) {
2141
2203
  type = mimeType;
2142
- if (mimeType === QUICKTIME_MIMETYPE && (containerFormat === MP4_CONTAINER || containerFormat === MOV_CONTAINER) && videoCodec === H264_CODEC) type = MP4_MIMETYPE;
2204
+ if ((mimeType === QUICKTIME_MIMETYPE || mimeType === M4V_MIMETYPE) && (containerFormat === MP4_CONTAINER || containerFormat === MOV_CONTAINER) && videoCodec === H264_CODEC) type = MP4_MIMETYPE;
2143
2205
  }
2144
2206
 
2145
2207
  if (uri) {
@@ -2169,6 +2231,7 @@ var filterShapeSource = function filterShapeSource() {
2169
2231
  var IMAGE = 'IMAGE';
2170
2232
  var AUDIO = 'AUDIO';
2171
2233
  var VIDEO = 'VIDEO';
2234
+ var DOCUMENT = 'DOCUMENT';
2172
2235
 
2173
2236
  var getShapeMediaType = function getShapeMediaType() {
2174
2237
  var shape = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
@@ -2187,6 +2250,11 @@ var getShapeMediaType = function getShapeMediaType() {
2187
2250
  }
2188
2251
 
2189
2252
  if (mimeType.startsWith('image/')) return IMAGE;
2253
+ if (mimeType.endsWith('/pdf')) return DOCUMENT;
2254
+ if (mimeType.startsWith('text/')) return DOCUMENT;
2255
+ if (mimeType.endsWith('/msword')) return DOCUMENT;
2256
+ if (mimeType.endsWith('/json')) return DOCUMENT;
2257
+ if (mimeType.endsWith('/xml')) return DOCUMENT;
2190
2258
  return undefined;
2191
2259
  };
2192
2260
 
@@ -2505,5 +2573,23 @@ var parseHighlightTimespanList = function parseHighlightTimespanList() {
2505
2573
  }, {});
2506
2574
  };
2507
2575
 
2508
- export { createFacetType, createMetadataType, filterShapeSource, findNearestThumbnail, findTimespan, formatSeconds, formatSecondsPrecise, formatSmpte, formatTimeBase, formatTimeBaseText, formatTimeBaseType, formatTimeCodeText, formatTimeCodeType, getShapeMediaType, metadataTypeToWebVtt, parseAspectRatio, parseAudioComponent, parseBaseMediaInfoType, parseBinaryComponent, parseContainerComponent, parseFacetType, parseFileType, parseHighlightTimespan, parseHighlightTimespanList, parseKeyValuePairType, parseMediaConvertPreset, parseMetadataType, parseNowDate, parseShapeType, parseSimpleMetadataType, parseTimespan, parseTimespanList, parseTranscodePreset, parseVideoComponent, roles, sortTimespanList };
2576
+ var PDF = 'PDF';
2577
+ var TEXT = 'TEXT';
2578
+ var MSWORD = 'MSWORD';
2579
+ var JSON$1 = 'JSON';
2580
+ var XML = 'XML';
2581
+
2582
+ var getDocumentType = function getDocumentType() {
2583
+ var shape = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
2584
+ var mimeType = shape.mimeType;
2585
+ if (!mimeType) return undefined;
2586
+ if (mimeType.endsWith('/pdf')) return PDF;
2587
+ if (mimeType.startsWith('text/')) return TEXT;
2588
+ if (mimeType.endsWith('/msword')) return MSWORD;
2589
+ if (mimeType.endsWith('/json')) return JSON$1;
2590
+ if (mimeType.endsWith('/xml')) return XML;
2591
+ return undefined;
2592
+ };
2593
+
2594
+ export { TimeBase, TimeCode, createFacetType, createMetadataType, filterShapeSource, findNearestThumbnail, findTimespan, formatSeconds, formatSecondsPrecise, formatSmpte, formatTimeBase, formatTimeBaseText, formatTimeBaseType, formatTimeCodeText, formatTimeCodeType, getDocumentType, getShapeMediaType, metadataTypeToWebVtt, parseAspectRatio, parseAudioComponent, parseBaseMediaInfoType, parseBinaryComponent, parseContainerComponent, parseFacetType, parseFileType, parseHighlightTimespan, parseHighlightTimespanList, parseKeyValuePairType, parseMediaConvertPreset, parseMetadataType, parseNowDate, parseShapeType, parseSimpleMetadataType, parseTimespan, parseTimespanList, parseTranscodePreset, parseVideoComponent, roles, sortTimespanList };
2509
2595
  //# sourceMappingURL=index.es.js.map