@@ -106,6 +106,11 @@ const props = defineProps({
106106 type: String ,
107107 default: ' main'
108108 },
109+ nextHandleIn: {
110+ // Handle-in frame of the next entity, used to pre-seek its decoder
111+ type: Number ,
112+ default: 0
113+ },
109114 panzoom: {
110115 type: Boolean ,
111116 default: false
@@ -401,6 +406,19 @@ const reloadCurrentEntity = (silentReload = false) => {
401406 loadEntity (currentIndex .value , currentPlayer .value .currentTime , silentReload)
402407}
403408
409+ // Park the preloaded decoder on the next entity's handle-in frame so its
410+ // first frame (slate) is never the one painted when players switch.
411+ const preseekNextPlayer = () => {
412+ const player = nextPlayer .value
413+ if (! player || ! player .getAttribute (' src' ) || props .nextHandleIn <= 0 ) return
414+ const nextEntity = props .entities [getNextIndex (currentIndex .value )]
415+ const nextFps =
416+ parseFloat (nextEntity? .fps ) ||
417+ parseFloat (currentProduction .value ? .fps ) ||
418+ DEFAULT_FPS
419+ player .currentTime = props .nextHandleIn / nextFps
420+ }
421+
404422const loadEntity = (index = 0 , currentTime = 0 , silentLoad = false ) => {
405423 if (index < props .entities .length ) {
406424 const nextIndex = getNextIndex (index)
@@ -436,6 +454,7 @@ const loadEntity = (index = 0, currentTime = 0, silentLoad = false) => {
436454 if (! nextPlayer .value .src .endsWith (nextMoviePath)) {
437455 nextPlayer .value .src = nextMoviePath
438456 }
457+ preseekNextPlayer ()
439458 } else if (nextPlayer .value ) {
440459 nextPlayer .value .src = ' '
441460 }
@@ -596,6 +615,7 @@ const switchPlayers = () => {
596615 nextPlayer .value = tmpPlayer
597616 if (nextEntity) {
598617 nextPlayer .value .src = getMoviePath (nextEntity)
618+ preseekNextPlayer ()
599619 }
600620 resetHeight ()
601621 setSpeed (rate)
@@ -710,6 +730,15 @@ watch(
710730 }
711731)
712732
733+ // At switch time the prop still holds the previous "next" value: re-apply
734+ // the pre-seek once the parent pushes the new next entity's handle-in.
735+ watch (
736+ () => props .nextHandleIn ,
737+ () => {
738+ preseekNextPlayer ()
739+ }
740+ )
741+
713742watch (
714743 () => props .entities ,
715744 () => {
0 commit comments