You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm drawing cues into a container with a fluid size - it resizes as the browser window changes. I would like to redraw the cues in the correct positions following a browser resize.
Right now, if I simply call processCues() again following a window resize event, it does not update the cue positions; they're simply redrawn back in the same positions, which might be offscreen (if the window was made smaller) or simply misplaced or in the wrong size.
The positions do correctly update following the next cue change.
I'm thinking that this could be solved by storing the height/width of the paddedOverlay box (where?), and having the shouldCompute function return true if the current size doesn't match the stored size.
The text was updated successfully, but these errors were encountered:
This how we do it: we have an additional parameter (forceCompute) which we pass to processCues (it looks like WebVTT.processCues(window, activeCues, ccArea, forceCompute)). If set to true this setting will force shouldCompute to return true. In case we need to resize the caption display area we call processCues with forceCompute set to true. In case this is just an update (as in timeupdate for HTML5 video) but without resizing we pass forceCompute to false. There is probably a better way but it does the job.
I'm drawing cues into a container with a fluid size - it resizes as the browser window changes. I would like to redraw the cues in the correct positions following a browser resize.
Right now, if I simply call
processCues()
again following a window resize event, it does not update the cue positions; they're simply redrawn back in the same positions, which might be offscreen (if the window was made smaller) or simply misplaced or in the wrong size.The positions do correctly update following the next cue change.
I'm thinking that this could be solved by storing the height/width of the
paddedOverlay
box (where?), and having theshouldCompute
function returntrue
if the current size doesn't match the stored size.The text was updated successfully, but these errors were encountered: