fix(montage): seek on every frame step while paused
4be5ef8 parent: eb1339b modified
web/src/project/steps/derush/usePlaylist.ts +2 -1 | @@ -72,7 +72,8 @@ export function usePlaylist(pieces: Ref<Piece[]>) { | ||
| 72 | 72 | v.src = p.src; |
| 73 | 73 | // appliqué une fois le fichier chargé (position de départ par défaut) |
| 74 | 74 | v.currentTime = at; |
| 75 | - } else if (Math.abs(v.currentTime - at) > 0.05) v.currentTime = at; | |
| 75 | + // à l'arrêt, le moindre écart compte : une image ne dure que 33 à 40 ms (pas à pas) | |
| 76 | + } else if (Math.abs(v.currentTime - at) > (playing.value ? 0.05 : 0.001)) v.currentTime = at; | |
| 76 | 77 | if (playing.value) v.play().catch(() => {}); |
| 77 | 78 | } |
| 78 | 79 | |
| @@ -72,7 +72,8 @@ export function usePlaylist(pieces: Ref<Piece[]>) { | |||
| 72 | v.src = p.src; | 72 | v.src = p.src; |
| 73 | // appliqué une fois le fichier chargé (position de départ par défaut) | 73 | // appliqué une fois le fichier chargé (position de départ par défaut) |
| 74 | v.currentTime = at; | 74 | v.currentTime = at; |
| 75 | - } else if (Math.abs(v.currentTime - at) > 0.05) v.currentTime = at; | 75 | + // à l'arrêt, le moindre écart compte : une image ne dure que 33 à 40 ms (pas à pas) |
| 76 | + } else if (Math.abs(v.currentTime - at) > (playing.value ? 0.05 : 0.001)) v.currentTime = at; | ||
| 76 | if (playing.value) v.play().catch(() => {}); | 77 | if (playing.value) v.play().catch(() => {}); |
| 77 | } | 78 | } |
| 78 | 79 | ||
modified
web/src/project/steps/montage/LayerVideo.vue +1 -1 | @@ -10,7 +10,7 @@ function sync() { | ||
| 10 | 10 | const v = el.value; |
| 11 | 11 | if (!v) return; |
| 12 | 12 | const want = Math.max(0, props.time); |
| 13 | - if (Math.abs(v.currentTime - want) > (props.playing ? 0.3 : 0.04)) v.currentTime = want; | |
| 13 | + if (Math.abs(v.currentTime - want) > (props.playing ? 0.3 : 0.001)) v.currentTime = want; | |
| 14 | 14 | if (props.playing && v.paused) v.play().catch(() => {}); |
| 15 | 15 | if (!props.playing && !v.paused) v.pause(); |
| 16 | 16 | } |
| @@ -10,7 +10,7 @@ function sync() { | |||
| 10 | const v = el.value; | 10 | const v = el.value; |
| 11 | if (!v) return; | 11 | if (!v) return; |
| 12 | const want = Math.max(0, props.time); | 12 | const want = Math.max(0, props.time); |
| 13 | - if (Math.abs(v.currentTime - want) > (props.playing ? 0.3 : 0.04)) v.currentTime = want; | 13 | + if (Math.abs(v.currentTime - want) > (props.playing ? 0.3 : 0.001)) v.currentTime = want; |
| 14 | if (props.playing && v.paused) v.play().catch(() => {}); | 14 | if (props.playing && v.paused) v.play().catch(() => {}); |
| 15 | if (!props.playing && !v.paused) v.pause(); | 15 | if (!props.playing && !v.paused) v.pause(); |
| 16 | } | 16 | } |