Skip to content
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

Merged

Conversation

aescarcha
Copy link
Contributor

addCue method crashed with Invalid argument after seeking back, a simple track reset if the exception happens fixes this. #2524

@epiclabsDASH
Copy link
Contributor

From @padninja:

The fix for #2527 only seems to work if you seek back to a point that was not yet visited. When I seek back to a point that was already requested the text is not displayed. If you delete all cues for a track I would think that you would need to delete the corresponding executed fragment requests as well.

@@ -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());
Copy link
Contributor

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.

Copy link
Contributor Author

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

Copy link
Contributor

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

Copy link
Contributor Author

@aescarcha aescarcha Apr 18, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants