@@ -291,9 +291,10 @@ export class Html5Player extends Player {
291291
292292 // Captured frames are SVG images, which can't load remote files, so ingest files are inlined as data URIs.
293293 // Callers await this only when the asset has ingest URLs, so other assets compose without yielding.
294- private async composeWithIngestFiles ( asset : Html5Asset ) : Promise < string > {
294+ // Every frame decodes its inlined images again, so a scaled bake inlines images sized for its scale.
295+ private async composeWithIngestFiles ( asset : Html5Asset , scale : number = 1 ) : Promise < string > {
295296 const longestEdge = html5ClipLongestEdge ( this . clipConfiguration , this . edit . getResolvedEdit ( ) ?. output ) ;
296- return composeHtml5IframeSrcdoc ( await inlineHtml5IngestAssets ( asset , longestEdge ) ) ;
297+ return composeHtml5IframeSrcdoc ( await inlineHtml5IngestAssets ( asset , longestEdge * scale ) ) ;
297298 }
298299
299300 private async mountIframe ( asset : Html5Asset ) : Promise < void > {
@@ -442,7 +443,7 @@ export class Html5Player extends Player {
442443 // An earlier capture may have seeked this iframe, and a seeked animation can leave state
443444 // a fresh page lacks (GSAP writes start values inline once a tween has
444445 // rendered). The backend captures from a fresh page, so capture does too.
445- if ( ! ( await this . loadFreshPage ( this . iframe , stale ) ) ) return null ;
446+ if ( ! ( await this . loadFreshPage ( this . iframe , stale , scale ) ) ) return null ;
446447
447448 const { frameCount } = computeHtml5FrameCount ( {
448449 clipLengthSeconds : this . getLength ( ) ,
@@ -535,8 +536,9 @@ export class Html5Player extends Player {
535536 return true ;
536537 }
537538
538- private async loadFreshPage ( iframe : HTMLIFrameElement , stale : ( ) => boolean ) : Promise < boolean > {
539- const srcdoc = findHtml5IngestUrls ( this . asset ) . length > 0 ? await this . composeWithIngestFiles ( this . asset ) : composeHtml5IframeSrcdoc ( this . asset ) ;
539+ private async loadFreshPage ( iframe : HTMLIFrameElement , stale : ( ) => boolean , scale : number = 1 ) : Promise < boolean > {
540+ const srcdoc =
541+ findHtml5IngestUrls ( this . asset ) . length > 0 ? await this . composeWithIngestFiles ( this . asset , scale ) : composeHtml5IframeSrcdoc ( this . asset ) ;
540542 if ( stale ( ) ) return false ;
541543 iframe . srcdoc = srcdoc ; // eslint-disable-line no-param-reassign -- reloading the iframe it is given is this helper's job
542544 await waitForIframeLoad ( iframe , undefined , true ) ;
0 commit comments