Skip to content

Commit

Permalink
slight improvement to processMetadataQueue_
Browse files Browse the repository at this point in the history
  • Loading branch information
ldayananda committed Sep 6, 2018
1 parent 6144d15 commit d75a2d0
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/segment-loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -1147,10 +1147,11 @@ export default class SegmentLoader extends videojs.EventTarget {
if (this.checkForAbort_(simpleSegment.requestId) ||
this.abortRequestEarly_(simpleSegment.stats)) {
return;
}

// This could only happen with fmp4 segments, but
// should still not happen in general
} else if (captions.length === 0) {
if (captions.length === 0) {
this.logger_('SegmentLoader received no captions from a caption event');
return;
}
Expand Down Expand Up @@ -1216,13 +1217,11 @@ export default class SegmentLoader extends videojs.EventTarget {
}

processMetadataQueue_() {
const id3Queue = this.metadataQueue_.id3;
const captionQueue = this.metadataQueue_.caption;
this.metadataQueue_.id3.forEach((fn) => fn());
this.metadataQueue_.caption.forEach((fn) => fn());

this.metadataQueue_.id3 = [];
this.metadataQueue_.caption = [];
id3Queue.forEach((fn) => fn());
captionQueue.forEach((fn) => fn());
}

processCallQueue_() {
Expand Down

0 comments on commit d75a2d0

Please sign in to comment.