Skip to content

Commit

Permalink
Check for text track changes that occurred before tech was listening
Browse files Browse the repository at this point in the history
  • Loading branch information
gesinger committed Nov 23, 2015
1 parent 6bbd6f1 commit b02fdef
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/js/tech/tech.js
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,7 @@ class Tech extends Component {
}
});

textTracksChanges();
tracks.addEventListener('change', textTracksChanges);

this.on('dispose', function() {
Expand Down
10 changes: 10 additions & 0 deletions test/unit/tracks/tracks.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -342,3 +342,13 @@ if (Html5.supportsNativeTextTracks()) {
emulatedTt.on('addtrack', addtrack);
});
}

test('should check for text track changes when emulating text tracks', function() {
let tech = new Tech();
let numTextTrackChanges = 0;
tech.on('texttrackchange', function() {
numTextTrackChanges++;
});
tech.emulateTextTracks();
equal(numTextTrackChanges, 1, 'we got a texttrackchange event');
});

0 comments on commit b02fdef

Please sign in to comment.