# Video Playback Feature - E2E Documentation ## Overview The Tour Builder Platform implements a comprehensive video playback system supporting forward and reverse playback modes. The system handles background videos, video player elements, and transition animations between pages in both Constructor (editing) and Runtime (presentation) modes. --- ## Architecture ``` ┌─────────────────────────────────────────────────────────────────┐ │ Video Types │ │ Background Videos │ Video Player Elements │ Transition Videos │ └─────────────────────────────────────────────────────────────────┘ │ ┌─────────────────────────────────────────────────────────────────┐ │ Playback Hooks │ │ useTransitionPlayback │ useReversePlayback │ usePageSwitch │ │ useBackgroundVideoPlayback (background video time control) │ └─────────────────────────────────────────────────────────────────┘ │ ┌─────────────────────────────────────────────────────────────────┐ │ Preloading Layer │ │ usePreloadOrchestrator │ getReadyBlobUrl (O(1)) │ S3 Presign │ └─────────────────────────────────────────────────────────────────┘ │ ┌─────────────────────────────────────────────────────────────────┐ │ Utilities │ │ mediaDuration.ts │ assetUrl.ts │ StorageManager (Cache API) │ └─────────────────────────────────────────────────────────────────┘ │ ┌─────────────────────────────────────────────────────────────────┐ │ Rendering │ │ Constructor Page │ RuntimePresentation │ Transition Overlay │ └─────────────────────────────────────────────────────────────────┘ ``` --- ## Video Types ### 1. Background Videos Full-screen videos that play behind page content with configurable playback settings. ```tsx // Using useBackgroundVideoPlayback hook for custom time control const { videoRef, shouldBlockAutoplay } = useBackgroundVideoPlayback({ videoUrl: page.background_video_url, autoplay: page.background_video_autoplay ?? true, loop: page.background_video_loop ?? true, muted: page.background_video_muted ?? true, startTime: page.background_video_start_time ?? null, endTime: page.background_video_end_time ?? null, }); // Block autoplay if video already played this session (when loop=false) const effectiveAutoplay = (page.background_video_autoplay ?? true) && !shouldBlockAutoplay;