fix(DORIS-2053): apply WebVTT cue settings when dispatchForManualRendering is enabled - #69
Open
eowino wants to merge 1 commit into
Open
Conversation
…bled TextTracks.addCaptions builds cues via _handleCaptionEvents when dispatchForManualRendering is on, and that path returned the cue without copying currentItem.styles onto it. align/line/position/size were silently dropped, so every WebVTT cue rendered bottom-centre regardless of its cue settings. Only _handleNonHtmlCaption applied them. Move the style application into _getCueInformationForNonHtml so every non-HTML path gets it, rather than fixing the one caller. This also covers _appendFragmentedWebVtt (wvtt in fMP4), which was equally affected and has no test coverage here. The HTML/TTML path is untouched. Note the styles are now applied during cue construction rather than after _getCueInformation returns.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
TextTracks.addCaptionspicks the cue-construction path based on thedispatchForManualRenderingsetting:Only
_handleNonHtmlCaptioncopiedcurrentItem.stylesonto the cue. WithdispatchForManualRendering: true,_handleCaptionEventsreturned the cue unstyled, soalign/line/position/sizeparsed out of the WebVTT were silently dropped and every cue rendered bottom-centre regardless of its cue settings.VTTParserwas never at fault — it returns the settings correctly. They were discarded downstream.Fix
Move the style application out of
_handleNonHtmlCaptioninto_getCueInformationForNonHtml, the constructor every non-HTML path funnels through via_getCueInformation.Fixing the shared constructor rather than the one broken caller also covers
_appendFragmentedWebVtt(wvttin fMP4), which had the identical defect. The HTML/TTML path (_getCueInformationForHtml) is untouched.Behavioural note: settings are now applied during cue construction rather than after
_getCueInformationreturns._handleCaptionEventsonly deletescue.typeinonenter, andmanualCueProcessingreadstrack.manualCueList— neither touches positioning.