Skip to content

Commit

Permalink
@gkatsev fixed disabling of default text tracks. closes #1892
Browse files Browse the repository at this point in the history
  • Loading branch information
gkatsev authored and heff committed Feb 26, 2015
1 parent 0b392fa commit 2a1f9f3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ CHANGELOG
=========

## HEAD (Unreleased)
_(none)_
* @gkatsev fixed disabling of default text tracks ([view](https://github.com/videojs/video.js/pull/1892))

--------------------

Expand Down
7 changes: 4 additions & 3 deletions src/js/media/html5.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ vjs.Html5.prototype.createEl = function(){


vjs.Html5.prototype.hideCaptions = function() {
var tracks = this.el_.textTracks,
var tracks = this.el_.querySelectorAll('track'),
track,
i = tracks.length,
kinds = {
Expand All @@ -176,8 +176,9 @@ vjs.Html5.prototype.hideCaptions = function() {
};

while (i--) {
track = tracks[i];
if (track && track['kind'] in kinds) {
track = tracks[i].track;
if ((track && track['kind'] in kinds) &&
(!tracks[i]['default'])) {
track.mode = 'disabled';
}
}
Expand Down

1 comment on commit 2a1f9f3

@duraki
Copy link
Contributor

@duraki duraki commented on 2a1f9f3 Feb 26, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Finally. Thanks!

Please sign in to comment.