File tree Expand file tree Collapse file tree 1 file changed +13
-6
lines changed
Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ export function Playback() {
2626 onChange : setTime ,
2727 value : time ?? 0 ,
2828 min : 0 ,
29- max : timespan ,
29+ max : max ( [ timespan - 1 , 0 ] ) ,
3030 step : 1 ,
3131 label : "Time" ,
3232 disabled : ! timespan ,
@@ -54,14 +54,21 @@ export function Playback() {
5454 const interval = setInterval ( ( ) => {
5555 const tb = now ( ) ;
5656 const next =
57- min ( [
58- store . get ( timeAtom ) +
59- max ( [ 1 , store . get ( speedAtom ) * round ( ( tb - ta ) / frame ) ] ) ! ,
60- store . get ( lengthAtom ) ,
57+ max ( [
58+ min ( [
59+ store . get ( timeAtom ) +
60+ max ( [ 1 , store . get ( speedAtom ) * round ( ( tb - ta ) / frame ) ] ) ! ,
61+ store . get ( lengthAtom ) - 1 ,
62+ ] ) ,
63+ 0 ,
6164 ] ) ?? 0 ;
6265 set ( { time : next } ) ;
6366 setTime ( next ) ;
64- if ( next && next === store . get ( lengthAtom ) && ! store . get ( bufferingAtom ) ) {
67+ if (
68+ next &&
69+ next === store . get ( lengthAtom ) - 1 &&
70+ ! store . get ( bufferingAtom )
71+ ) {
6572 setPlaying ( false ) ;
6673 }
6774 ta = tb ;
You can’t perform that action at this time.
0 commit comments