@desynova-digital/player 3.13.10 → 3.13.12
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.
|
@@ -104,7 +104,7 @@ var MarkOutControl = /*#__PURE__*/function (_Component) {
|
|
|
104
104
|
markerPos: 'right',
|
|
105
105
|
currentTime: player.currentTime
|
|
106
106
|
};
|
|
107
|
-
onAddMarker(leftMarker, player.currentTime, 'update', false, data);
|
|
107
|
+
onAddMarker(leftMarker, player.currentTime, player.markerType !== 'update' ? 'add' : 'update', false, data);
|
|
108
108
|
// onAddMarker(leftMarker, player.currentTime);
|
|
109
109
|
}
|
|
110
110
|
}
|
package/package.json
CHANGED
package/utils/index.js
CHANGED
|
@@ -40,25 +40,46 @@ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input ==
|
|
|
40
40
|
* @function secondsToTime
|
|
41
41
|
*/
|
|
42
42
|
function secondsToTime() {
|
|
43
|
-
var
|
|
44
|
-
var frameRate = arguments.length > 1 ? arguments[1] :
|
|
45
|
-
var
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
var
|
|
53
|
-
var
|
|
54
|
-
var
|
|
55
|
-
|
|
56
|
-
var
|
|
57
|
-
|
|
58
|
-
|
|
43
|
+
var seconds = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
44
|
+
var frameRate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 25;
|
|
45
|
+
var initialTimecodeInSeconds = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
46
|
+
if (seconds > -1) {
|
|
47
|
+
var totalFrames = Math.round((seconds + initialTimecodeInSeconds) * frameRate);
|
|
48
|
+
|
|
49
|
+
// Calculate new timecode
|
|
50
|
+
var newFrames = totalFrames;
|
|
51
|
+
var newSeconds = Math.floor(newFrames / frameRate);
|
|
52
|
+
var remainderFrames = newFrames % frameRate;
|
|
53
|
+
var newFF = remainderFrames.toString().padStart(2, '0');
|
|
54
|
+
var newSS = newSeconds % 60;
|
|
55
|
+
var newMM = Math.floor(newSeconds / 60) % 60;
|
|
56
|
+
var newHH = Math.floor(newSeconds / 3600);
|
|
57
|
+
|
|
58
|
+
// Format and return the new timecode
|
|
59
|
+
return "".concat(newHH.toString().padStart(2, '0'), ":").concat(newMM.toString().padStart(2, '0'), ":").concat(newSS.toString().padStart(2, '0'), ":").concat(newFF);
|
|
59
60
|
}
|
|
60
|
-
return
|
|
61
|
+
return '00:00:00:00';
|
|
61
62
|
}
|
|
63
|
+
|
|
64
|
+
// export function secondsToTime(_seconds = 0, frameRate, initialTime) {
|
|
65
|
+
// let time = '00:00:00:00';
|
|
66
|
+
// _seconds = parseFloat(_seconds);
|
|
67
|
+
// if (_seconds > -1) {
|
|
68
|
+
// if (initialTime) {
|
|
69
|
+
// _seconds += initialTime;
|
|
70
|
+
// }
|
|
71
|
+
// const date = new Date(null);
|
|
72
|
+
// const currentFrame = Math.round((_seconds * frameRate) % frameRate);
|
|
73
|
+
// const paddedFrame = currentFrame < 10 ? `0${currentFrame}` : currentFrame;
|
|
74
|
+
// date.setSeconds(_seconds);
|
|
75
|
+
// const timeString = date.toISOString().substr(11, 8);
|
|
76
|
+
// const timeWithFrame = `${timeString}:${paddedFrame}`;
|
|
77
|
+
// time = timeWithFrame;
|
|
78
|
+
// }
|
|
79
|
+
|
|
80
|
+
// return time;
|
|
81
|
+
// }
|
|
82
|
+
|
|
62
83
|
function timeToSeconds() {
|
|
63
84
|
var time = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '00:00:00:00';
|
|
64
85
|
var frameRate = arguments.length > 1 ? arguments[1] : undefined;
|