Skip to content

Commit

Permalink
add additional check for no subtitle tracks
Browse files Browse the repository at this point in the history
  • Loading branch information
OrenMe committed Oct 7, 2019
1 parent eb35560 commit cb263f9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/controller/subtitle-stream-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export class SubtitleStreamController extends BaseStreamController {
onSubtitleTrackSwitch (data) {
this.currentTrackId = data.id;

if (!this.tracks || this.currentTrackId === -1) {
if (!this.tracks || !this.tracks.length || this.currentTrackId === -1) {
this.clearInterval();
return;
}
Expand Down

0 comments on commit cb263f9

Please sign in to comment.