Skip to content

Commit ddaf3f2

Browse files
authored
Merge pull request #171 from hyperaudio/170-video-textTracks-fix
Fix for video.textTracks[0] undefined
2 parents b0feabb + 10b4929 commit ddaf3f2

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

js/caption.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*! (C) The Hyperaudio Project. MIT @license: en.wikipedia.org/wiki/MIT_License. */
2-
/*! Version 2.1.3 patch*/
2+
/*! Version 2.1.3 patch 2*/
33
'use strict';
44

55
var caption = function () {
@@ -308,8 +308,6 @@ var caption = function () {
308308
var track = document.getElementById(playerId+'-vtt');
309309
track.kind = "captions";
310310

311-
console.log("label = "+label);
312-
313311
if (label !== undefined) {
314312
console.log("setting label as "+label);
315313
track.label = label;
@@ -326,7 +324,7 @@ var caption = function () {
326324
video.removeEventListener("loadedmetadata", listener, true);
327325
}, true);
328326

329-
if (video.textTracks !== undefined) {
327+
if (video.textTracks[0] !== undefined) {
330328
video.textTracks[0].mode = "showing";
331329
}
332330
}

0 commit comments

Comments
 (0)