mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-03-11 21:27:05 +00:00
throw error if subtitles failed to parse
This commit is contained in:
parent
8a4825e1a2
commit
f27c29980c
1 changed files with 4 additions and 0 deletions
|
|
@ -159,6 +159,10 @@ function HTMLSubtitles(options) {
|
||||||
.then(function(text) {
|
.then(function(text) {
|
||||||
if (typeof text === 'string' && selectedTrackId === selecterdTrack.id) {
|
if (typeof text === 'string' && selectedTrackId === selecterdTrack.id) {
|
||||||
cuesByTime = subtitlesParser.parse(text);
|
cuesByTime = subtitlesParser.parse(text);
|
||||||
|
if (cuesByTime.times.length === 0) {
|
||||||
|
throw new Error('parse failed');
|
||||||
|
}
|
||||||
|
|
||||||
events.emit('trackLoaded', selecterdTrack);
|
events.emit('trackLoaded', selecterdTrack);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue