-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed an edge issue causing text track to stop working when seeking back #2527
Fixed an edge issue causing text track to stop working when seeking back #2527
Conversation
…o a previous time
From @padninja:
|
@@ -348,6 +348,8 @@ function TextSourceBuffer() { | |||
result = parser.parse(ccContent, offsetTime, sampleStart / timescale, (sampleStart + sample.duration) / timescale, images); | |||
textTracks.addCaptions(currFragmentedTrackIdx, firstSubtitleStart / timescale, result); | |||
} catch (e) { | |||
fragmentModel.removeExecutedRequestsBeforeTime(Date.now()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to call Date.now(), an empty argument will remove all the executed requests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would cause a comparison of a number
and undefined - number
, that's number >= NaN
. I don't really like that, but I'll change it if it's necessary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @aescarcha ,
sorry I don't see where the problem is. If time is undefined, the filter function of the array will return false. Do I miss something?
Nico
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @nicosang It's just that it looks a bit obscure for me. I'll remove it now.
addCue
method crashed withInvalid argument
after seeking back, a simple track reset if the exception happens fixes this. #2524