Skip to content

Commit 29e24b6

Browse files
ericdemersclaude
andcommitted
Fix sample video paths for GitHub Pages deployment
Use import.meta.env.BASE_URL to correctly resolve paths when deployed to /feedback-loop/ subdirectory 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
1 parent f0bca0a commit 29e24b6

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

src/components/Video/SampleVideoSelector.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,12 @@ export default function SampleVideoSelector({ isOpen, onClose, onVideoSelect }:
4646
const loadSampleData = async () => {
4747
setLoading(true);
4848
setError(null);
49-
49+
5050
try {
51-
const response = await fetch('/sample-videos/sample-data.json');
51+
const basePath = import.meta.env.BASE_URL;
52+
const response = await fetch(`${basePath}sample-videos/sample-data.json`);
5253
if (!response.ok) throw new Error('Failed to load sample data');
53-
54+
5455
const data = await response.json();
5556
setSampleVideos(data.videos);
5657
} catch (err) {
@@ -64,14 +65,15 @@ export default function SampleVideoSelector({ isOpen, onClose, onVideoSelect }:
6465
const handleVideoSelect = async (video: SampleVideo) => {
6566
try {
6667
// Create a VideoFile object from the sample video
68+
const basePath = import.meta.env.BASE_URL;
6769
const videoFile: VideoFile = {
6870
file: null, // Sample videos don't have original file
69-
url: `/sample-videos/${video.filename}`,
71+
url: `${basePath}sample-videos/${video.filename}`,
7072
name: video.filename,
7173
size: 0, // Size will be determined when loaded
7274
duration: 0 // Duration will be determined when loaded
7375
};
74-
76+
7577
onVideoSelect(videoFile, video);
7678
onClose();
7779
} catch (err) {

0 commit comments

Comments
 (0)