Skip to content

Commit

Permalink
Merge branch 'stable'
Browse files Browse the repository at this point in the history
  • Loading branch information
gkatsev committed Apr 19, 2016
2 parents cfb9621 + aa94e0b commit b931b6b
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ CHANGELOG

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

## 5.9.2 (2016-04-19)
* @gkatsev grouped text track errors in the console, if we can ([view](/~https://github.com/videojs/video.js/pull/3259))

## 5.9.1 (2016-04-19)
* @benjipott updated IS_CHROME to not be true on MS Edge ([view](/~https://github.com/videojs/video.js/pull/3232))
* @mister-ben blacklisted Chrome for Android for playback rate support ([view](/~https://github.com/videojs/video.js/pull/3246))
Expand Down
2 changes: 1 addition & 1 deletion component.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "video.js",
"description": "An HTML5 and Flash video player with a common API and skin for both.",
"version": "5.9.1",
"version": "5.9.2",
"keywords": [
"videojs",
"html5",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "video.js",
"description": "An HTML5 and Flash video player with a common API and skin for both.",
"version": "5.9.1",
"version": "5.9.2",
"copyright": "Copyright Brightcove, Inc. <https://www.brightcove.com/>",
"license": "Apache-2.0",
"keywords": [
Expand Down
13 changes: 12 additions & 1 deletion src/js/tracks/text-track.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,14 @@ const parseCues = function(srcContent, track) {
let parser = new window.WebVTT.Parser(window,
window.vttjs,
window.WebVTT.StringDecoder());
let errors = [];

parser.oncue = function(cue) {
track.addCue(cue);
};

parser.onparsingerror = function(error) {
log.error(error);
errors.push(error);
};

parser.onflush = function() {
Expand All @@ -40,6 +41,16 @@ const parseCues = function(srcContent, track) {
};

parser.parse(srcContent);
if (errors.length > 0) {
if (console.groupCollapsed) {
console.groupCollapsed(`Text Track parsing errors for ${track.src}`);
}
errors.forEach((error) => log.error(error));
if (console.groupEnd) {
console.groupEnd();
}
}

parser.flush();
};

Expand Down

0 comments on commit b931b6b

Please sign in to comment.