-
Notifications
You must be signed in to change notification settings - Fork 7.4k
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
feat: support vtt regions #6694
base: main
Are you sure you want to change the base?
Conversation
src/js/tracks/text-track-display.js
Outdated
@@ -243,7 +243,7 @@ class TextTrackDisplay extends Component { | |||
const tracks = this.player_.textTracks(); | |||
const allowMultipleShowingTracks = this.options_.allowMultipleShowingTracks; | |||
|
|||
this.clearDisplay(); | |||
// this.clearDisplay(); |
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.
probably should do this in a backwards compatible way, so, if someone is using an older vttjs, captions don't just accumulate.
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.
Looks like vtt.js already removed old things, so, this was never necessary, really. The addition of the else below with clearDisplay is necessary though for when turning all the captions off.
Thus, this line can be removed and we will be backward and forward compatible.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
@@ -290,6 +288,8 @@ class TextTrackDisplay extends Component { | |||
this.setAttribute('aria-live', 'assertive'); | |||
} | |||
this.updateForTrack(descriptionsTrack); | |||
} else { | |||
this.clearDisplay(); |
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.
This is necessary to clear the cues whenever we turn off all the captions. This makes it so that this PR is backward and forwards compatible.
This depends on PR videojs/vtt.js#50 and would need a new vttjs release.
The change is fairly simple and stays within the current API constraints of vttjs.
The only change necessary for regions is to not clear the display ourselves but let vttjs handle it now.
TODO