@desynova-digital/player 3.13.11 → 3.13.13

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 (2) hide show
  1. package/package.json +1 -1
  2. package/utils/index.js +16 -13
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@desynova-digital/player",
3
- "version": "3.13.11",
3
+ "version": "3.13.13",
4
4
  "description": "Video Player Package for Contido Application",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/utils/index.js CHANGED
@@ -43,19 +43,22 @@ function secondsToTime() {
43
43
  var seconds = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
44
44
  var frameRate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 25;
45
45
  var initialTimecodeInSeconds = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
46
- var totalFrames = Math.round((seconds + initialTimecodeInSeconds) * frameRate);
47
-
48
- // Calculate new timecode
49
- var newFrames = totalFrames;
50
- var newSeconds = Math.floor(newFrames / frameRate);
51
- var remainderFrames = newFrames % frameRate;
52
- var newFF = remainderFrames.toString().padStart(2, '0');
53
- var newSS = newSeconds % 60;
54
- var newMM = Math.floor(newSeconds / 60) % 60;
55
- var newHH = Math.floor(newSeconds / 3600);
56
-
57
- // Format and return the new timecode
58
- return "".concat(newHH.toString().padStart(2, '0'), ":").concat(newMM.toString().padStart(2, '0'), ":").concat(newSS.toString().padStart(2, '0'), ":").concat(newFF);
46
+ if (seconds > -1) {
47
+ var totalFrames = Math.round((seconds + (initialTimecodeInSeconds || 0)) * 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);
60
+ }
61
+ return '00:00:00:00';
59
62
  }
60
63
 
61
64
  // export function secondsToTime(_seconds = 0, frameRate, initialTime) {