@vidispine/vdt-js 22.3.0-pre.1 → 22.3.0-pre.4

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
@@ -908,27 +908,28 @@ var parseHighlightTimespanList = function parseHighlightTimespanList() {
908
908
  }, {});
909
909
  };
910
910
 
911
- var _CONSTANT_TIMEBASES;
912
-
913
- var PAL = 'PAL';
914
- var NTSC = 'NTSC';
915
- var NTSC30 = 'NTSC30';
916
- var CONSTANT_TIMEBASES = (_CONSTANT_TIMEBASES = {}, _defineProperty(_CONSTANT_TIMEBASES, PAL, {
917
- denominator: 25,
918
- numerator: 1
919
- }), _defineProperty(_CONSTANT_TIMEBASES, NTSC, {
920
- denominator: 30000,
921
- numerator: 1001
922
- }), _defineProperty(_CONSTANT_TIMEBASES, NTSC30, {
923
- denominator: 30,
924
- numerator: 1
925
- }), _defineProperty(_CONSTANT_TIMEBASES, 29.97, {
926
- denominator: 30000,
927
- numerator: 1001
928
- }), _defineProperty(_CONSTANT_TIMEBASES, 59.94, {
929
- denominator: 60000,
930
- numerator: 1001
931
- }), _CONSTANT_TIMEBASES);
911
+ var CONSTANT_TIMEBASES = {
912
+ PAL: {
913
+ denominator: 25,
914
+ numerator: 1
915
+ },
916
+ NTSC: {
917
+ denominator: 30000,
918
+ numerator: 1001
919
+ },
920
+ NTSC30: {
921
+ denominator: 30,
922
+ numerator: 1
923
+ },
924
+ 29.97: {
925
+ denominator: 30000,
926
+ numerator: 1001
927
+ },
928
+ 59.94: {
929
+ denominator: 60000,
930
+ numerator: 1001
931
+ }
932
+ };
932
933
  var FRAME_SEPARATORS = {
933
934
  ':': {
934
935
  dropFrame: false,
@@ -948,96 +949,13 @@ var FRAME_SEPARATORS = {
948
949
  }
949
950
  };
950
951
 
951
- function ownKeys$2(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
952
-
953
- function _objectSpread$2(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$2(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$2(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
954
-
955
- var splitSmpte = function splitSmpte(smpteText) {
956
- var hasDropFrameSeparator = smpteText.match(/[^0-9:\-_]/);
957
- var hhmmssff;
958
- var frameOptions = {};
959
-
960
- if (hasDropFrameSeparator) {
961
- var _hasDropFrameSeparato = _slicedToArray(hasDropFrameSeparator, 1),
962
- frameSeparator = _hasDropFrameSeparato[0];
963
-
964
- var _smpteText$split = smpteText.split(frameSeparator),
965
- _smpteText$split2 = _slicedToArray(_smpteText$split, 2),
966
- hhmmss = _smpteText$split2[0],
967
- splitFrames = _smpteText$split2[1];
968
-
969
- hhmmssff = [].concat(_toConsumableArray(hhmmss.split(':')), [splitFrames]);
970
- frameOptions = FRAME_SEPARATORS[frameSeparator] || {};
971
- } else {
972
- hhmmssff = smpteText.split(':');
973
- }
974
-
975
- hhmmssff = hhmmssff.map(Number);
976
-
977
- if (hhmmssff.length > 4 || hhmmssff.some(function (n) {
978
- return Number.isNaN(n);
979
- })) {
980
- throw new Error('Invalid SMPTE timecode');
981
- }
982
-
983
- return [hhmmssff, frameOptions];
984
- };
985
-
986
- var getDropFrames = function getDropFrames(roundedFrameRate) {
987
- return roundedFrameRate === 60 ? 4 : 2;
988
- };
989
-
990
- var getRoundedFrameRate = function getRoundedFrameRate(timeBase) {
991
- return Math.round(timeBase.denominator / timeBase.numerator);
992
- };
993
-
994
- var countSamples = function countSamples(hh, mm, ss, ff, _ref) {
995
- var dropFrame = _ref.dropFrame,
996
- roundedFrameRate = _ref.roundedFrameRate;
997
-
998
- if (!dropFrame) {
999
- return hh * 3600 * roundedFrameRate + mm * 60 * roundedFrameRate + ss * roundedFrameRate + ff;
1000
- }
1001
-
1002
- if (![30, 60].includes(roundedFrameRate)) {
1003
- throw new Error('Cannot use dropframe with non NTSC timebase');
1004
- }
1005
-
1006
- var dropFrames = getDropFrames(roundedFrameRate);
1007
- var shouldDropMinute = mm % 10 !== 0;
1008
- var shouldDropSecond = shouldDropMinute && ss === 0;
1009
- var hourFrames = hh * (3600 * roundedFrameRate - 54 * dropFrames);
1010
- var minuteFrames = mm * 60 * roundedFrameRate - (mm - Math.ceil(mm / 10)) * dropFrames;
1011
- var secondFrames = ss * roundedFrameRate - (shouldDropMinute && ss > 1 ? dropFrames : 0);
1012
-
1013
- if (shouldDropSecond && ff < dropFrames) {
1014
- throw new Error('Invalid ff');
1015
- }
1016
-
1017
- var frameFrames = shouldDropSecond ? ff - dropFrames : ff;
1018
- return hourFrames + minuteFrames + secondFrames + frameFrames;
1019
- };
1020
-
1021
- function countDroppedFrames(frames, roundedFrameRate) {
1022
- var dropFrames = getDropFrames(roundedFrameRate);
1023
- var oneMinuteUndroppedFrames = 60 * roundedFrameRate;
1024
- var oneMinuteDroppedFrames = 60 * roundedFrameRate - dropFrames;
1025
- var tenMinuteFrames = 10 * (oneMinuteUndroppedFrames - dropFrames) + dropFrames;
1026
- var tenMinuteChunks = Math.floor(frames / tenMinuteFrames);
1027
- var minuteRemainder = Math.max(0, frames % tenMinuteFrames - oneMinuteUndroppedFrames);
1028
- var oneMinuteChunks = Math.floor(minuteRemainder / oneMinuteDroppedFrames);
1029
- var frameRemainder = minuteRemainder % oneMinuteDroppedFrames;
1030
- var frameChunks = frameRemainder > 0 ? dropFrames : 0;
1031
- return tenMinuteChunks * 9 * dropFrames + oneMinuteChunks * dropFrames + frameChunks;
1032
- }
1033
-
1034
952
  var TimeBase = /*#__PURE__*/function () {
1035
953
  function TimeBase() {
1036
- var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
1037
- _ref2$numerator = _ref2.numerator,
1038
- numerator = _ref2$numerator === void 0 ? 1 : _ref2$numerator,
1039
- _ref2$denominator = _ref2.denominator,
1040
- denominator = _ref2$denominator === void 0 ? 1 : _ref2$denominator;
954
+ var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
955
+ _ref$numerator = _ref.numerator,
956
+ numerator = _ref$numerator === void 0 ? 1 : _ref$numerator,
957
+ _ref$denominator = _ref.denominator,
958
+ denominator = _ref$denominator === void 0 ? 1 : _ref$denominator;
1041
959
 
1042
960
  _classCallCheck(this, TimeBase);
1043
961
 
@@ -1121,23 +1039,94 @@ var TimeBase = /*#__PURE__*/function () {
1121
1039
  return TimeBase;
1122
1040
  }();
1123
1041
 
1124
- var isDropFrameTimeBase = function isDropFrameTimeBase(_ref3) {
1125
- var numerator = _ref3.numerator,
1126
- denominator = _ref3.denominator;
1042
+ var formatTimeBaseType = function formatTimeBaseType(timeBase) {
1043
+ return new TimeBase(timeBase);
1044
+ };
1045
+
1046
+ var formatTimeBaseText = function formatTimeBaseText(timeBaseText) {
1047
+ if (timeBaseText === undefined) {
1048
+ return formatTimeBaseType();
1049
+ }
1050
+
1051
+ if (typeof timeBaseText === 'number') {
1052
+ return formatTimeBaseType({
1053
+ denominator: timeBaseText
1054
+ });
1055
+ }
1056
+
1057
+ if (timeBaseText.includes(':')) {
1058
+ var _timeBaseText$split = timeBaseText.split(':'),
1059
+ _timeBaseText$split2 = _slicedToArray(_timeBaseText$split, 2),
1060
+ _denominator = _timeBaseText$split2[0],
1061
+ numerator = _timeBaseText$split2[1];
1062
+
1063
+ return formatTimeBaseType({
1064
+ denominator: _denominator,
1065
+ numerator: numerator
1066
+ });
1067
+ }
1068
+
1069
+ if (Object.keys(CONSTANT_TIMEBASES).includes(timeBaseText)) {
1070
+ return formatTimeBaseType(CONSTANT_TIMEBASES[timeBaseText]);
1071
+ }
1072
+
1073
+ var denominator = Number(timeBaseText);
1074
+
1075
+ if (Number.isNaN(denominator)) {
1076
+ throw new Error("timeBaseText must be a number or ".concat(Object.keys(CONSTANT_TIMEBASES).join(','), " - is ").concat(timeBaseText));
1077
+ }
1078
+
1079
+ return formatTimeBaseType({
1080
+ denominator: denominator
1081
+ });
1082
+ };
1083
+
1084
+ var formatTimeBase = function formatTimeBase(timeBase) {
1085
+ if (_typeof(timeBase) === 'object') {
1086
+ return formatTimeBaseType(timeBase);
1087
+ }
1088
+
1089
+ return formatTimeBaseText(timeBase);
1090
+ };
1091
+
1092
+ var getDropFrames$1 = function getDropFrames(roundedFrameRate) {
1093
+ return roundedFrameRate === 60 ? 4 : 2;
1094
+ };
1095
+
1096
+ var getRoundedFrameRate$1 = function getRoundedFrameRate(timeBase) {
1097
+ return Math.round(timeBase.denominator / timeBase.numerator);
1098
+ };
1099
+
1100
+ function countDroppedFrames(frames, roundedFrameRate) {
1101
+ var dropFrames = getDropFrames$1(roundedFrameRate);
1102
+ var oneMinuteUndroppedFrames = 60 * roundedFrameRate;
1103
+ var oneMinuteDroppedFrames = 60 * roundedFrameRate - dropFrames;
1104
+ var tenMinuteFrames = 10 * (oneMinuteUndroppedFrames - dropFrames) + dropFrames;
1105
+ var tenMinuteChunks = Math.floor(frames / tenMinuteFrames);
1106
+ var minuteRemainder = Math.max(0, frames % tenMinuteFrames - oneMinuteUndroppedFrames);
1107
+ var oneMinuteChunks = Math.floor(minuteRemainder / oneMinuteDroppedFrames);
1108
+ var frameRemainder = minuteRemainder % oneMinuteDroppedFrames;
1109
+ var frameChunks = frameRemainder > 0 ? dropFrames : 0;
1110
+ return tenMinuteChunks * 9 * dropFrames + oneMinuteChunks * dropFrames + frameChunks;
1111
+ }
1112
+
1113
+ var isDropFrameTimeBase = function isDropFrameTimeBase(_ref) {
1114
+ var numerator = _ref.numerator,
1115
+ denominator = _ref.denominator;
1127
1116
  return numerator === 1001 && (denominator === 60000 || denominator === 30000);
1128
1117
  };
1129
1118
 
1130
1119
  var TimeCode = /*#__PURE__*/function () {
1131
1120
  function TimeCode() {
1132
- var _ref4 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
1133
- _ref4$samples = _ref4.samples,
1134
- samples = _ref4$samples === void 0 ? 0 : _ref4$samples,
1135
- timeBase = _ref4.timeBase;
1121
+ var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
1122
+ _ref2$samples = _ref2.samples,
1123
+ samples = _ref2$samples === void 0 ? 0 : _ref2$samples,
1124
+ timeBase = _ref2.timeBase;
1136
1125
 
1137
- var _ref5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
1138
- dropFrame = _ref5.dropFrame,
1139
- _ref5$field = _ref5.field,
1140
- field = _ref5$field === void 0 ? 2 : _ref5$field;
1126
+ var _ref3 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
1127
+ dropFrame = _ref3.dropFrame,
1128
+ _ref3$field = _ref3.field,
1129
+ field = _ref3$field === void 0 ? 2 : _ref3$field;
1141
1130
 
1142
1131
  _classCallCheck(this, TimeCode);
1143
1132
 
@@ -1245,7 +1234,7 @@ var TimeCode = /*#__PURE__*/function () {
1245
1234
  }, {
1246
1235
  key: "toTime",
1247
1236
  value: function toTime() {
1248
- var roundedFrameRate = getRoundedFrameRate(this.timeBase);
1237
+ var roundedFrameRate = getRoundedFrameRate$1(this.timeBase);
1249
1238
  var totalSamples = this.samples + (this.dropFrame ? countDroppedFrames(this.samples + 1, roundedFrameRate) : 0);
1250
1239
  var hours = Math.floor(totalSamples / (3600 * roundedFrameRate));
1251
1240
  var minutes = Math.floor(totalSamples / (60 * roundedFrameRate)) % 60;
@@ -1263,8 +1252,8 @@ var TimeCode = /*#__PURE__*/function () {
1263
1252
  }, {
1264
1253
  key: "toDuration",
1265
1254
  value: function toDuration() {
1266
- var _ref6 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
1267
- format = _ref6.format;
1255
+ var _ref4 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
1256
+ format = _ref4.format;
1268
1257
 
1269
1258
  var _this$toTime = this.toTime(),
1270
1259
  hours = _this$toTime.hours,
@@ -1290,7 +1279,7 @@ var TimeCode = /*#__PURE__*/function () {
1290
1279
  }, {
1291
1280
  key: "toSmpte",
1292
1281
  value: function toSmpte() {
1293
- var _this2 = this;
1282
+ var _this = this;
1294
1283
 
1295
1284
  if (this.samples === -Infinity) return '00:00:00:00';
1296
1285
 
@@ -1308,7 +1297,7 @@ var TimeCode = /*#__PURE__*/function () {
1308
1297
  dropFrame = _thisSeparator$.dropFrame,
1309
1298
  field = _thisSeparator$.field;
1310
1299
 
1311
- return dropFrame === _this2.dropFrame && field === _this2.field;
1300
+ return dropFrame === _this.dropFrame && field === _this.field;
1312
1301
  }),
1313
1302
  _Object$entries$find2 = _slicedToArray(_Object$entries$find, 1),
1314
1303
  _Object$entries$find3 = _Object$entries$find2[0],
@@ -1326,56 +1315,6 @@ var TimeCode = /*#__PURE__*/function () {
1326
1315
  return TimeCode;
1327
1316
  }();
1328
1317
 
1329
- var formatTimeBaseType = function formatTimeBaseType(timeBase) {
1330
- return new TimeBase(timeBase);
1331
- };
1332
-
1333
- var formatTimeBaseText = function formatTimeBaseText(timeBaseText) {
1334
- if (timeBaseText === undefined) {
1335
- return formatTimeBaseType();
1336
- }
1337
-
1338
- if (typeof timeBaseText === 'number') {
1339
- return formatTimeBaseType({
1340
- denominator: timeBaseText
1341
- });
1342
- }
1343
-
1344
- if (timeBaseText.includes(':')) {
1345
- var _timeBaseText$split = timeBaseText.split(':'),
1346
- _timeBaseText$split2 = _slicedToArray(_timeBaseText$split, 2),
1347
- _denominator = _timeBaseText$split2[0],
1348
- numerator = _timeBaseText$split2[1];
1349
-
1350
- return formatTimeBaseType({
1351
- denominator: _denominator,
1352
- numerator: numerator
1353
- });
1354
- }
1355
-
1356
- if (Object.keys(CONSTANT_TIMEBASES).includes(timeBaseText)) {
1357
- return formatTimeBaseType(CONSTANT_TIMEBASES[timeBaseText]);
1358
- }
1359
-
1360
- var denominator = Number(timeBaseText);
1361
-
1362
- if (Number.isNaN(denominator)) {
1363
- throw new Error("timeBaseText must be a number or ".concat(Object.keys(CONSTANT_TIMEBASES).join(','), " - is ").concat(timeBaseText));
1364
- }
1365
-
1366
- return formatTimeBaseType({
1367
- denominator: denominator
1368
- });
1369
- };
1370
-
1371
- var formatTimeBase = function formatTimeBase(timeBase) {
1372
- if (_typeof(timeBase) === 'object') {
1373
- return formatTimeBaseType(timeBase);
1374
- }
1375
-
1376
- return formatTimeBaseText(timeBase);
1377
- };
1378
-
1379
1318
  var formatTimeCodeType = function formatTimeCodeType(timeCode, options) {
1380
1319
  return new TimeCode(timeCode, options);
1381
1320
  };
@@ -1445,11 +1384,11 @@ var formatSeconds = function formatSeconds(seconds, timeBase, options) {
1445
1384
  throw new Error("seconds must be digits, is ".concat(seconds));
1446
1385
  }
1447
1386
 
1448
- var _ref7 = timeBase || {},
1449
- _ref7$denominator = _ref7.denominator,
1450
- denominator = _ref7$denominator === void 0 ? 1 : _ref7$denominator,
1451
- _ref7$numerator = _ref7.numerator,
1452
- numerator = _ref7$numerator === void 0 ? 1 : _ref7$numerator;
1387
+ var _ref = timeBase || {},
1388
+ _ref$denominator = _ref.denominator,
1389
+ denominator = _ref$denominator === void 0 ? 1 : _ref$denominator,
1390
+ _ref$numerator = _ref.numerator,
1391
+ numerator = _ref$numerator === void 0 ? 1 : _ref$numerator;
1453
1392
 
1454
1393
  var samples = seconds * (denominator / numerator);
1455
1394
  var timeCode = {
@@ -1464,13 +1403,13 @@ var formatSecondsPrecise = function formatSecondsPrecise(seconds, timeBase, opti
1464
1403
  throw new Error("seconds must be digits, is ".concat(seconds));
1465
1404
  }
1466
1405
 
1467
- var _ref8 = timeBase || {},
1468
- _ref8$numerator = _ref8.numerator,
1469
- numerator = _ref8$numerator === void 0 ? 1 : _ref8$numerator;
1406
+ var _ref = timeBase || {},
1407
+ _ref$numerator = _ref.numerator,
1408
+ numerator = _ref$numerator === void 0 ? 1 : _ref$numerator;
1470
1409
 
1471
- var _ref9 = timeBase || {},
1472
- _ref9$denominator = _ref9.denominator,
1473
- denominator = _ref9$denominator === void 0 ? 1 : _ref9$denominator;
1410
+ var _ref2 = timeBase || {},
1411
+ _ref2$denominator = _ref2.denominator,
1412
+ denominator = _ref2$denominator === void 0 ? 1 : _ref2$denominator;
1474
1413
 
1475
1414
  if (!Number.isInteger(seconds)) {
1476
1415
  var decimalPlaces = String(seconds).split('.')[1].length;
@@ -1488,17 +1427,87 @@ var formatSecondsPrecise = function formatSecondsPrecise(seconds, timeBase, opti
1488
1427
  return new TimeCode(timeCode, options);
1489
1428
  };
1490
1429
 
1430
+ function ownKeys$2(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
1431
+
1432
+ function _objectSpread$2(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$2(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$2(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
1433
+
1434
+ var getDropFrames = function getDropFrames(roundedFrameRate) {
1435
+ return roundedFrameRate === 60 ? 4 : 2;
1436
+ };
1437
+
1438
+ var getRoundedFrameRate = function getRoundedFrameRate(timeBase) {
1439
+ return Math.round(timeBase.denominator / timeBase.numerator);
1440
+ };
1441
+
1442
+ var splitSmpte = function splitSmpte(smpteText) {
1443
+ var hasDropFrameSeparator = smpteText.match(/[^0-9:\-_]/);
1444
+ var hhmmssff;
1445
+ var frameOptions = {};
1446
+
1447
+ if (hasDropFrameSeparator) {
1448
+ var _hasDropFrameSeparato = _slicedToArray(hasDropFrameSeparator, 1),
1449
+ frameSeparator = _hasDropFrameSeparato[0];
1450
+
1451
+ var _smpteText$split = smpteText.split(frameSeparator),
1452
+ _smpteText$split2 = _slicedToArray(_smpteText$split, 2),
1453
+ hhmmss = _smpteText$split2[0],
1454
+ splitFrames = _smpteText$split2[1];
1455
+
1456
+ hhmmssff = [].concat(_toConsumableArray(hhmmss.split(':')), [splitFrames]);
1457
+ frameOptions = FRAME_SEPARATORS[frameSeparator] || {};
1458
+ } else {
1459
+ hhmmssff = smpteText.split(':');
1460
+ }
1461
+
1462
+ hhmmssff = hhmmssff.map(Number);
1463
+
1464
+ if (hhmmssff.length > 4 || hhmmssff.some(function (n) {
1465
+ return Number.isNaN(n);
1466
+ })) {
1467
+ throw new Error('Invalid SMPTE timecode');
1468
+ }
1469
+
1470
+ return [hhmmssff, frameOptions];
1471
+ };
1472
+
1473
+ var countSamples = function countSamples(hh, mm, ss, ff, _ref) {
1474
+ var dropFrame = _ref.dropFrame,
1475
+ roundedFrameRate = _ref.roundedFrameRate;
1476
+
1477
+ if (!dropFrame) {
1478
+ return hh * 3600 * roundedFrameRate + mm * 60 * roundedFrameRate + ss * roundedFrameRate + ff;
1479
+ }
1480
+
1481
+ if (![30, 60].includes(roundedFrameRate)) {
1482
+ throw new Error('Cannot use dropframe with non NTSC timebase');
1483
+ }
1484
+
1485
+ var dropFrames = getDropFrames(roundedFrameRate);
1486
+ var shouldDropMinute = mm % 10 !== 0;
1487
+ var shouldDropSecond = shouldDropMinute && ss === 0;
1488
+ var hourFrames = hh * (3600 * roundedFrameRate - 54 * dropFrames);
1489
+ var minuteFrames = mm * 60 * roundedFrameRate - (mm - Math.ceil(mm / 10)) * dropFrames;
1490
+ var secondFrames = ss * roundedFrameRate - (shouldDropMinute && ss > 1 ? dropFrames : 0);
1491
+
1492
+ if (shouldDropSecond && ff < dropFrames) {
1493
+ throw new Error('Invalid ff');
1494
+ }
1495
+
1496
+ var frameFrames = shouldDropSecond ? ff - dropFrames : ff;
1497
+ return hourFrames + minuteFrames + secondFrames + frameFrames;
1498
+ };
1499
+
1491
1500
  var formatSmpte = function formatSmpte(smpteText, timeBaseText) {
1492
1501
  var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
1493
1502
 
1494
1503
  if (smpteText === undefined) {
1495
1504
  var _timeBase = formatTimeBase(timeBaseText);
1496
1505
 
1497
- var _timeCode6 = {
1506
+ var _timeCode = {
1498
1507
  samples: 0,
1499
1508
  timeBase: _timeBase
1500
1509
  };
1501
- return formatTimeCodeType(_timeCode6);
1510
+ return formatTimeCodeType(_timeCode);
1502
1511
  }
1503
1512
 
1504
1513
  if (typeof smpteText !== 'string') {
@@ -1560,7 +1569,7 @@ function timeToCueTime(_ref) {
1560
1569
  */
1561
1570
 
1562
1571
 
1563
- function metadataTypeToWebVtt(_ref2) {
1572
+ var metadataTypeToWebVtt = function metadataTypeToWebVtt(_ref2) {
1564
1573
  var metadataType = _ref2.metadataType,
1565
1574
  _ref2$subtitleGroup = _ref2.subtitleGroup,
1566
1575
  subtitleGroup = _ref2$subtitleGroup === void 0 ? 'stl_subtitle' : _ref2$subtitleGroup,
@@ -1596,7 +1605,10 @@ function metadataTypeToWebVtt(_ref2) {
1596
1605
  return "".concat(start, " --> ").concat(end, " line:0%\r").concat(text, "\r");
1597
1606
  });
1598
1607
  return "WEBVTT\n\n\n".concat(vttCues.join('\n'));
1599
- }
1608
+ };
1609
+
1610
+ var SYSTEM_FIELDGROUPS = ['stl_subtitle', 'stl_tti', 'stl_gsi', 'mrk_marker', 'pho_validation', 'pho_resource', 'pho_error', 'facedetect_rect', 'facedetect_face', 'originalTrackFilename', 'stl_gsiHeader'];
1611
+ var SYSTEM_FIELDS = ['title', 'user', 'shapeTag', 'representativeThumbnail', 'representativeThumbnailNoAuth', 'representativeItems', 'itemId', 'collectionId', 'mediaType', 'mimeType', 'created', 'startTimeCode', 'startSeconds', 'fieldValidationError', 'schemaValidationError', 'originalFilename', 'originalUri', 'originalAudioCodec', 'originalVideoCodec', 'originalHeight', 'originalWidth', 'originalFormat', 'durationSeconds', 'durationTimeCode', 'solr-index', '__user', '__collection', '__collection_size', '__ancestor_collection', '__ancestor_collection_size', '__shape', '__shape_size', '__shape_last_added', '__placeholder_shape_size', '__version', '__version_count', '__storage', '__storage_size', '__shapetag_{tag}_hash_{hash}', '__storage_{tag}', '__storage_{tag}_size', '__storagegroup', '__storagegroup_size', '__sequence', '__sequence_size', '__metadata_last_modified', '__external_id', '__deletion_lock_id', '__deletion_lock_expiry', '__child_collection', '__child_collection_size', '__parent_collection', '__parent_collection_size', '__items_size', 'stl_text', 'stl_justification', 'stl_xrelative', 'stl_yrelative', 'stl_vertical', 'stl_verticalbase', 'stl_horizontalbase', 'stl_sizerelative', 'stl_color', 'stl_outline', 'stl_outlinecolor', 'stl_outlinesize', 'stl_font', 'stl_service', 'stl_tti', 'stl_gsi', 'cct', 'tcd', 'tcf', 'oet', 'cd', 'mnc', 'cpn', 'dfc', 'tcp', 'tcs', 'tet', 'tnb', 'tnd', 'en', 'co', 'tng', 'rd', 'mnr', 'dsc', 'opt', 'lc', 'tpt', 'tn', 'slr', 'tns', 'rn', 'pub', 'dsn', 'ecd', 'mrk_zerolength', 'mrk_text', 'mrk_color', 'pho_resource_name', 'pho_error_level', 'pho_error_code', 'pho_error_description', 'facedetect_rect_width', 'facedetect_rect_height', 'facedetect_rect_y', 'facedetect_rect_x', 'facedetect_pid', 'facedetect_rect', 'trackId', 'eidr_actor', 'eidr_alternateId', 'eidr_countryOfOrigin', 'eidr_director', 'eidr_id', 'eidr_referentType', 'eidr_releaseDate', 'eidr_resourceName', 'eidr_status', 'eidr_sync', 'ttml_div', 'ttml_root', 'vxa_collection_id', 'vxaId', 'vxaLocalPath', 'tco', 'cs', 'ebn', 'tf', 'cf', 'sgn', 'tci', 'jc', 'vp', 'sn'];
1600
1612
 
1601
1613
  var createFacetType = function createFacetType() {
1602
1614
  var fieldList = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
@@ -2057,6 +2069,7 @@ var IMAGE = 'IMAGE';
2057
2069
  var AUDIO = 'AUDIO';
2058
2070
  var VIDEO = 'VIDEO';
2059
2071
  var DOCUMENT = 'DOCUMENT';
2072
+ var BINARY = 'BINARY';
2060
2073
  var getShapeMediaType = function getShapeMediaType() {
2061
2074
  var shapeType = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
2062
2075
  var mimeType = shapeType.mimeType,
@@ -2079,6 +2092,7 @@ var getShapeMediaType = function getShapeMediaType() {
2079
2092
  if (mimeType.endsWith('/msword')) return DOCUMENT;
2080
2093
  if (mimeType.endsWith('/json')) return DOCUMENT;
2081
2094
  if (mimeType.endsWith('/xml')) return DOCUMENT;
2095
+ if (mimeType.endsWith('/octet-stream')) return BINARY;
2082
2096
  return undefined;
2083
2097
  };
2084
2098
 
@@ -2296,5 +2310,5 @@ var getDocumentType = function getDocumentType() {
2296
2310
  return undefined;
2297
2311
  };
2298
2312
 
2299
- export { TimeBase, TimeCode, createFacetType, createMetadataType, filterShapeSource, findNearestThumbnail, 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 };
2313
+ export { SYSTEM_FIELDGROUPS, SYSTEM_FIELDS, TimeBase, TimeCode, createFacetType, createMetadataType, filterShapeSource, findNearestThumbnail, 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 };
2300
2314
  //# sourceMappingURL=index.es.js.map