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

fix: duplicate 608/708 VTT lines #3321

Merged
merged 1 commit into from Jan 25, 2021

Conversation

OrenMe
Copy link
Collaborator

@OrenMe OrenMe commented Dec 21, 2020

This PR will...

fix duplicate 608 lines

Why is this Pull Request needed?

On rendition switching the liones may get duplicated

Are there any points in the code the reviewer needs to double check?

Reuse the hash function when creating the 608/708 VTTCues to assign them a unique id.
Extract the webvtt-parser callback function that adds text track cues and reuse it for adding the 608/708 cues.

Wasn't sure what is the best way to use the hash function - if to leave it in webvtt-aprser and expose or extract it to a seperate vtt utils function and import in both parser and cues modules.
I ended up exposing it from webvtt-parser and adding the id in timeline-controller, but it makes more sense to keep the logic near where VTTCue is created.
Let me know if you want to change this in anyway- open for comments.

In addition, added text field to VTTCue interface.

Resolves issues:

Checklist

  • changes have been done against master branch, and PR does not conflict
  • new unit / functional tests have been added (whenever applicable)
  • API or design changes are documented in API.md

Reuse the hash function when creating the 608/708 VTTCues to assign them a unique id.
Extract the webvtt-parser callback function that adds text track cues and reuse it for adding the 608/708 cues.

Wasn't sure what is the best way to use the hash function - if to leave it in webvtt-aprser and expose or extract it to a seperate vtt utils function and import in both parser and cues modules.
I ended up exposing it from webvtt-parser and adding the id in timeline-controller, but it makes more sense to keep the logic near where VTTCue is created.
Let me know if you want to change this in anyway- open for comments.

In addition, added text field to VTTCue interface.
@OrenMe OrenMe requested a review from robwalch December 21, 2020 09:59
@OrenMe OrenMe self-assigned this Dec 21, 2020
Copy link
Collaborator

@robwalch robwalch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if we deleted cues when we clear the buffer or remove a fragment from the fragment tracker first? This should apply to metadata cues as well from ID3 in audio (DATERANGE from playlist eventually too which will be a bit more challenging since for VOD those are loaded once per level). The cue source (a playlist or elementary stream) would determine if it needed to be deleted on level switch or buffer removal/replace.

Thanks for surfacing this and providing a fix! These changes make sense for v0.15 and v1.0. In v1 I want to also look into applying this logic to ID3 cues, as well flush cues from tracks with the buffer where applicable.

@robwalch robwalch added this to the 0.15.0 milestone Dec 22, 2020
@robwalch robwalch changed the base branch from master to patch/v0.15.x December 23, 2020 18:00
@robwalch robwalch added this to Top priorities in Release Planning and Backlog via automation Dec 29, 2020
@robwalch robwalch merged commit 09ad841 into video-dev:patch/v0.15.x Jan 25, 2021
robwalch pushed a commit that referenced this pull request Jan 25, 2021
robwalch pushed a commit that referenced this pull request Jan 28, 2021
Merges changes from #3321 into master, while maintaining that `config.cueHandler` must append cues to their supplied TextTrack
Comment on lines -71 to -73
for (let i = 0; i < sortedCues.length; i++) {
track.addCue(sortedCues[i]);
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @OrenMe,

I wonder if I could trouble you to make some changes after the fact...

I am working on bringing these changes into master for v1.0 and noticed that this CuesInterface is replaceable in the config via the cueHandler option. Someone might have replaced cueHandler to deal with 608 CC data and they expect that what is returned is not appended to the TextTrack because they either append it themselves as we did here, or they don't because they want to render cues some other way.

So what I would like us to do in this branch is what I am going to push for v1.0 in master:

robwalch pushed a commit that referenced this pull request Jan 28, 2021
Merges changes from #3321 into master, while maintaining that `config.cueHandler` must append cues to their supplied TextTrack
robwalch pushed a commit that referenced this pull request Jan 28, 2021
Merges changes from #3321 into master, while maintaining that `config.cueHandler` must append cues to their supplied TextTrack
robwalch pushed a commit that referenced this pull request Jan 28, 2021
Fix 608 CC continuity when seeking and while track is disabled
Merges changes from #3321 into master, while maintaining that `config.cueHandler` must append cues to their supplied TextTrack
robwalch pushed a commit that referenced this pull request Jan 28, 2021
Fix 608 CC continuity when seeking and while track is disabled
Clear tracks when level's text group-id changes
Update group-id on level switch not just level loading
Merges changes from #3321 into master, while maintaining that `config.cueHandler` must append cues to their supplied TextTrack
robwalch pushed a commit that referenced this pull request Jan 28, 2021
Fix 608 CC continuity when seeking and while track is disabled
Clear tracks when level's text group-id changes
Update group-id on level switch not just level loading
Merges changes from #3321 into master, while maintaining that `config.cueHandler` must append cues to their supplied TextTrack
robwalch pushed a commit that referenced this pull request Jan 28, 2021
Fix 608 CC continuity when seeking and while track is disabled
Clear tracks when level's text group-id changes
Update group-id on level switch not just level loading
Merges changes from #3321 into master, while maintaining that `config.cueHandler` must append cues to their supplied TextTrack
robwalch pushed a commit that referenced this pull request Jan 28, 2021
Fix 608 CC continuity when seeking and while track is disabled
Clear tracks when level's text group-id changes
Update group-id on level switch not just level loading
Merges changes from #3321 into master, while maintaining that `config.cueHandler` must append cues to their supplied TextTrack
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Release Planning and Backlog
  
Top priorities
Development

Successfully merging this pull request may close these issues.

None yet

2 participants