@@ -324,7 +324,7 @@ var captionBeingDisplayed = -1;
324324
325325/**
326326 * Display existing caption
327- * @param {[type] } seconds [description]
327+ * @param {[type] } seconds - time in seconds
328328 */
329329function displayExistingCaption ( seconds ) {
330330 var ci = findCaptionIndex ( seconds ) ;
@@ -360,7 +360,7 @@ function existingCaptionsEndTime() {
360360
361361/**
362362 * Update captions array.
363- * @param {[type] } vtt [description]
363+ * @param {string } vtt - VTT string
364364 */
365365let updateCaptionsArray = ( vtt ) => {
366366 let arr = vtt . split ( "\n\n" ) ;
@@ -665,8 +665,8 @@ let updateCaptionHtmlContent = () => {
665665
666666/**
667667 * Update caption.
668- * @param {[type] } ci caption index
669- * @param {[type] } captionText caption text
668+ * @param {int } ci - caption index
669+ * @param {string } captionText - caption text
670670 */
671671function updateCaption ( ci , captionText ) {
672672 captionsArray [ ci ] . caption = captionText ;
@@ -677,8 +677,8 @@ let lastEditedBlock = null;
677677
678678/**
679679 * Create a caption block object.
680- * @param {Object } newCaption Simple object representing the caption block
681- * @param {Function } spawnFunction Function to call after block init
680+ * @param {Object } newCaption - Simple object representing the caption block
681+ * @param {Function } spawnFunction - Function to call after block init
682682 */
683683function createCaptionBlock ( newCaption , spawnFunction ) {
684684 let captionText = newCaption . caption ;
@@ -871,7 +871,7 @@ function createCaptionBlock(newCaption, spawnFunction) {
871871
872872 /**
873873 * Spawn New Block
874- * @param {Event } e Triggered Event
874+ * @param {Event } e - Triggered Event
875875 */
876876 spawnNew : function ( e ) {
877877 e . preventDefault ( ) ;
@@ -900,7 +900,7 @@ function createCaptionBlock(newCaption, spawnFunction) {
900900
901901 /**
902902 * Delete Block
903- * @param {Event } e Triggered Event
903+ * @param {Event } e - Triggered Event
904904 */
905905 delete : function ( e ) {
906906 e . preventDefault ( ) ;
@@ -961,11 +961,14 @@ function createCaptionBlock(newCaption, spawnFunction) {
961961 this . div . append ( this . numberCharactersDiv ) ;
962962 this . div . append ( this . buttonsDiv ) ;
963963
964+ const nbCharsMsg = gettext ( "%s/%s characters" ) ;
964965 // Update numberCharactersDiv content
965966 const updateCharacterCount = ( ) => {
966967 let nbCharacters = this . captionTextInput . value . length ;
967- this . numberCharactersDiv . textContent =
968- nbCharacters + gettext ( "/80 characters" ) ;
968+ this . numberCharactersDiv . textContent = interpolate ( nbCharsMsg , [
969+ nbCharacters ,
970+ 80 ,
971+ ] ) ;
969972 if ( nbCharacters > 80 ) {
970973 this . numberCharactersDiv . append ( this . numberCharactersAlert ) ;
971974 }
@@ -1140,8 +1143,8 @@ editorShortcuts.init();
11401143
11411144/**
11421145 * Add caption list row
1143- * @param {[type] } ci [description]
1144- * @param {[type] } newCaption [description]
1146+ * @param {int } ci - Caption index
1147+ * @param {[type] } newCaption - Caption object
11451148 */
11461149function addCaptionListRow ( ci , newCaption ) {
11471150 let vtt = document . getElementById ( "caption-content" ) ;
@@ -1167,9 +1170,9 @@ function addCaptionListRow(ci, newCaption) {
11671170
11681171/**
11691172 * Add caption
1170- * @param {[type] } captionStart [description]
1171- * @param {[type] } captionEnd [description]
1172- * @param {[type] } captionText [description]
1173+ * @param {[type] } captionStart - Start time
1174+ * @param {[type] } captionEnd - End time
1175+ * @param {[type] } captionText - Caption content
11731176 */
11741177function addCaption ( captionStart , captionEnd , captionText ) {
11751178 const pod = document . getElementById ( "podvideoplayer" ) ;
@@ -1190,8 +1193,8 @@ function addCaption(captionStart, captionEnd, captionText) {
11901193
11911194/**
11921195 * Convert HMS time format to seconds only
1193- * @param {string } str hms
1194- * @return {number } corresponding seconds
1196+ * @param {string } str - hms
1197+ * @return {number } - corresponding seconds
11951198 */
11961199function hmsToSecondsOnly ( str ) {
11971200 let p = str . split ( ":" ) ,
@@ -1206,7 +1209,7 @@ function hmsToSecondsOnly(str) {
12061209
12071210/**
12081211 * Parses webvtt time string format into floating point seconds
1209- * @param {[type] } sTime [description]
1212+ * @param {[type] } sTime - Webvtt time string
12101213 */
12111214function parseTime ( sTime ) {
12121215 let seconds = hmsToSecondsOnly ( sTime ) ;
@@ -1228,7 +1231,7 @@ function parseTime(sTime) {
12281231
12291232/**
12301233 * formats floating point seconds into the webvtt time string format
1231- * @param {[type] } seconds [description]
1234+ * @param {[type] } seconds - floating point seconds
12321235 */
12331236function formatTime ( seconds ) {
12341237 var hh = Math . floor ( seconds / ( 60 * 60 ) ) ;
@@ -1246,7 +1249,7 @@ function formatTime(seconds) {
12461249
12471250/**
12481251 * Find caption index
1249- * @param {[type] } seconds [description]
1252+ * @param {[type] } seconds - Time in seconds
12501253 */
12511254function findCaptionIndex ( seconds ) {
12521255 var below = - 1 ;
@@ -1268,7 +1271,7 @@ function findCaptionIndex(seconds) {
12681271
12691272/**
12701273 * Play selected caption
1271- * @param { [type] } timeline [description]
1274+ * @param { string } timeline -
12721275 */
12731276function playSelectedCaption ( timeline ) {
12741277 if ( timeline . includes ( "-->" ) ) {
@@ -1288,7 +1291,7 @@ function playSelectedCaption(timeline) {
12881291
12891292/**
12901293 * Escape Html entities
1291- * @param {string } s String to be escaped
1294+ * @param {string } s - String to be escaped
12921295 */
12931296function XMLEncode ( s ) {
12941297 return s
@@ -1302,7 +1305,7 @@ function XMLEncode(s) {
13021305
13031306/**
13041307 * Decode Html entities
1305- * @param {String } s String to be decoded
1308+ * @param {String } s - String to be decoded
13061309 */
13071310function XMLDecode ( s ) {
13081311 return s
@@ -1315,7 +1318,7 @@ function XMLDecode(s) {
13151318
13161319/**
13171320 * Load caption file
1318- * @param {[type] } fileObject [description]
1321+ * @param {[type] } fileObject - File object to be loaded
13191322 */
13201323/*
13211324function loadCaptionFile(fileObject) {
@@ -1344,7 +1347,7 @@ function loadCaptionFile(fileObject) {
13441347
13451348/**
13461349 * Invoked by script insertion of proxyvtt.ashx
1347- * @param {[type] } obj [description]
1350+ * @param {[type] } obj -
13481351 */
13491352function processProxyVttResponse ( obj ) {
13501353 obj = JSON . parse ( obj ) ;
@@ -1376,7 +1379,7 @@ function processProxyVttResponse(obj) {
13761379
13771380/**
13781381 * Partial parser for WebVTT files based on the spec at http://dev.w3.org/html5/webvtt/
1379- * @param {[type] } vtt [description]
1382+ * @param {[type] } vtt - VTT file content
13801383 */
13811384function parseAndLoadWebVTT ( vtt ) {
13821385 var vttLines = vtt . split ( / \r \n | \r | \n / ) ; // create an array of lines from our file
@@ -1460,8 +1463,8 @@ const registerPlugin = videojs.registerPlugin || videojs.plugin;
14601463
14611464/**
14621465 * On player ready Event
1463- * @param {[type] } player [description]
1464- * @param {[type] } options [description]
1466+ * @param {[type] } player - Video player
1467+ * @param {[type] } options - Options (not used ?)
14651468 */
14661469const onPlayerReady = function ( player , options ) {
14671470 let startKeyframe ;
@@ -1483,8 +1486,8 @@ const onPlayerReady = function (player, options) {
14831486
14841487 /**
14851488 * Highlight video region
1486- * @param {[type] } startTime [description]
1487- * @param {[type] } endTime [description]
1489+ * @param {[type] } startTime - Start time in seconds
1490+ * @param {[type] } endTime - End time in seconds
14881491 */
14891492 highlightVideoRegion = function ( startTime , endTime ) {
14901493 clearVideoRegion ( ) ;
@@ -1520,7 +1523,7 @@ const onPlayerReady = function (player, options) {
15201523
15211524/**
15221525 * Seek video player to absolute `time`.
1523- * @param {[type] } time [description]
1526+ * @param {[type] } time - absolute time target
15241527 */
15251528function seekVideoTo ( time ) {
15261529 player . userActive ( true ) ;
@@ -1529,7 +1532,7 @@ function seekVideoTo(time) {
15291532
15301533/**
15311534 * Seek video player to relative `time`.
1532- * @param {[type] } time [description]
1535+ * @param {[type] } time - relative time target
15331536 */
15341537function seekVideo ( time ) {
15351538 player . userActive ( true ) ;
@@ -1538,7 +1541,7 @@ function seekVideo(time) {
15381541
15391542/**
15401543 * Timeline regions
1541- * @param {[type] } options [description]
1544+ * @param {[type] } options - Video player options
15421545 */
15431546function timelineRegions ( options ) {
15441547 this . ready ( function ( ) {
0 commit comments