saltfish
Version:
An interactive video-guided tour system for web applications
72 lines • 2.77 kB
TypeScript
import type { IStateMachineActionHandler, ManagedManagers } from './ServiceInterfaces';
import type { Step } from '../../types';
/**
* Service for handling state machine action registration and video-related utilities
*/
export declare class StateMachineActionHandler implements IStateMachineActionHandler {
private managers;
private destroyCallback;
private cursorAnimationListener;
private cursorAnimationVideoElement;
private cursorAnimationStepId;
constructor(managers: ManagedManagers);
/**
* Set the destroy callback for player destruction
*/
setDestroyCallback(callback: () => void): void;
/**
* Register all state machine actions with the store
*/
registerStateMachineActions(): void;
/**
* Gets the appropriate video URL for a step, preferring compressedUrl if available
* Also checks for translations if a language is configured
* Falls back to audioUrl if video URL is empty/missing
*/
getVideoUrl(step: Step): string;
/**
* Checks if a step is using audio fallback (when video URL is missing)
*/
isUsingAudioFallback(step: Step): boolean;
/**
* Finds the URL of the next video in the playlist for preloading
*/
findNextVideoUrl(currentStep: Step): string | null;
destroy(): void;
/**
* Cleans up the active cursor animation time listener
* @param stepId - Optional step ID to verify we're cleaning up the right listener
*/
private cleanupCursorAnimationListener;
/**
* Schedules a cursor animation to run either immediately or at a specific video time
* Note: Works for both video and audio-only steps (audio files use the same video element)
*/
private scheduleCursorAnimation;
/**
* Validates URL requirement for a specific step with retry logic
* @param step - The step to validate
* @returns Promise<boolean> - true if validation passes, false otherwise
*/
private validateStepUrlRequirement;
private handleStartVideoPlayback;
private handlePauseVideoPlayback;
private handleStartMutedLoopedVideo;
private handleStartIdleModeVideo;
private handleTrackPlaylistComplete;
private handleError;
private handleHideError;
private handleShowLoadingState;
private handleHideLoadingState;
private handleHideVideoControls;
private handleShowVideoControls;
private handleShowPlayButton;
private handleHidePlayButton;
private handleEnablePlayButtonProminent;
private handleDisablePlayButtonProminent;
private handleEnterCompactMode;
private handleExitCompactMode;
private handleTriggerPlaylistDismissed;
private handleScheduleDestroy;
}
//# sourceMappingURL=StateMachineActionHandler.d.ts.map