Skip to content

Commit 2112755

Browse files
0.1.2
- Now uses ESLint (ES2015) - Replaces var with let/const
1 parent 5abc5ac commit 2112755

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

create.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
/**
44
* @license Copyright (c) 2015-2018 Radiant Media Player
5-
* rmp-create-vtt-thumbnails 0.1.1 | https://github.com/radiantmediaplayer/rmp-create-vtt-thumbnails
5+
* rmp-create-vtt-thumbnails 0.1.2 | https://github.com/radiantmediaplayer/rmp-create-vtt-thumbnails
66
*/
77

88
'use strict';
@@ -11,7 +11,7 @@ const fs = require('fs');
1111
const eol = require('os').EOL;
1212

1313
// function to append data to our output VTT file
14-
var _appendFileSync = function (file, data) {
14+
const _appendFileSync = function (file, data) {
1515
try {
1616
fs.appendFileSync(file, data);
1717
} catch (err) {
@@ -21,7 +21,7 @@ var _appendFileSync = function (file, data) {
2121

2222
// function to convert second-based time to HH:MM:SS.xxxx format required for VTT compliance
2323
// see https://www.w3.org/TR/webvtt1/#webvtt-timestamp
24-
var _secondsToHRTime = function (time) {
24+
const _secondsToHRTime = function (time) {
2525
if (typeof time === 'number' && time >= 0) {
2626
let seconds = Math.floor(time % 60);
2727
let minutes = Math.floor(time * 1.0 / 60);
@@ -52,13 +52,13 @@ var _secondsToHRTime = function (time) {
5252
// parsing input from our command line
5353
// input params are: duration spriteFileLocation outputVTTFileName gapBetweenFrames thumbnailWidth thumbnailHeight tileSize
5454
// example: node create.js 596 assets/bbb-sprite.jpg output/bbb-thumbnails.vtt 5 128 72 11
55-
var duration;
56-
var spriteFileLocation;
57-
var outputVTTFileName;
58-
var gapBetweenFrames;
59-
var thumbnailWidth;
60-
var thumbnailHeight;
61-
var tileSize;
55+
let duration;
56+
let spriteFileLocation;
57+
let outputVTTFileName;
58+
let gapBetweenFrames;
59+
let thumbnailWidth;
60+
let thumbnailHeight;
61+
let tileSize;
6262
process.argv.forEach((value, index) => {
6363
switch (index) {
6464
case 2:
@@ -104,12 +104,12 @@ try {
104104
}
105105

106106
// append our initial VTT data for spec compliance
107-
var initialData = 'WEBVTT' + eol + eol;
107+
const initialData = 'WEBVTT' + eol + eol;
108108
_appendFileSync(outputVTTFileName, initialData);
109109

110110
// initial variables values for our loop
111-
var itemNumber = Math.floor(duration / gapBetweenFrames) + 1;
112-
var currentTime = 0;
111+
const itemNumber = Math.floor(duration / gapBetweenFrames) + 1;
112+
let currentTime = 0;
113113
let xCoordinates = 0;
114114
let yCoordinates = 0;
115115
let thumbnailSizeString = ',' + thumbnailWidth + ',' + thumbnailHeight + eol + eol;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"name": "rmp-create-vtt-thumbnails",
3-
"version": "0.1.1"
3+
"version": "0.1.2"
44
}

0 commit comments

Comments
 (0)