@@ -6,7 +6,7 @@ import type {
66 StreamMessagesInTimeRangeArgs ,
77 Subscription ,
88} from '@/core/types/player' ;
9- import { PLAYBACK_SPEED_MAX } from '@/core/types/player' ;
9+ import { MAX_PLAYBACK_SPEED } from '@/core/types/player' ;
1010import type { DataQualityReport , Time , Initialization , MessageEvent , TimeRange } from '@/core/types/ros' ;
1111import type { ISourceHandle } from '@/infra/workers/ISourceHandle' ;
1212import type { IMessageCursor } from '@/infra/workers/types' ;
@@ -469,7 +469,7 @@ export class IterablePlayer implements Player {
469469 this . _advancePlaybackEpoch ( ) ;
470470 this . _isPlaying = true ;
471471 const now = performance . now ( ) ;
472- this . _clock . play ( this . _currentTime , this . _speedFactor ( ) , now ) ;
472+ this . _clock . play ( this . _currentTime , this . _speed , now ) ;
473473 this . _lastTickWallMs = now ;
474474 this . _pageSuspended = typeof document !== "undefined" && document . hidden ;
475475 if ( this . _pageSuspended ) {
@@ -600,19 +600,11 @@ export class IterablePlayer implements Player {
600600 }
601601
602602 setSpeed ( speed : number ) : void {
603- if ( speed === PLAYBACK_SPEED_MAX ) {
604- this . _speed = PLAYBACK_SPEED_MAX ;
605- } else {
606- this . _speed = Math . min ( 8 , Math . max ( 0.1 , speed ) ) ;
607- }
608- this . _clock . setSpeed ( this . _speedFactor ( ) , performance . now ( ) ) ;
603+ this . _speed = Math . min ( MAX_PLAYBACK_SPEED , Math . max ( 0.1 , speed ) ) ;
604+ this . _clock . setSpeed ( this . _speed , performance . now ( ) ) ;
609605 this . _emitState ( ) ;
610606 }
611607
612- private _speedFactor ( ) : number {
613- return this . _speed === PLAYBACK_SPEED_MAX ? 64 : this . _speed ;
614- }
615-
616608 setSamplingFps ( fps : number ) : void {
617609 const clamped = Math . max ( 1 , Math . min ( MAX_SAMPLING_FPS , Math . round ( fps ) ) ) ;
618610 this . _samplingFps = clamped ;
0 commit comments