0

I'm trying to embed a local video file that I have stored on my raspberry pi onto a locally hosted apache webserver that I also have on my raspberry pi.

I've tried multiple solutions, including the ones here and here, but none of them have worked; there isn't even an error message, there's just nothing where the video is supposed to be, unless I have the 'controls' parameter enabled in which case there's just a black box with the video controls on it. Something of note is that videos do show up when I use youtube's embedding code.

Here's my current code:

<video width="420" height="340" autoplay>
<source src="file:///home/pi/test.webm" type="video/webm"> 
</video>

What exactly am I doing wrong here?

  • Did you try adding a path relative to your html file? like place them both in the same folder and use `src="./test.webm"` If you are viewing this html page over a webserver, you can't use `file:///` you need to add a relative path and that file should be accessible from the webroot – tHeSiD Jun 16 '20 at 18:08
  • Just tried that, said permission denied, so I'll mess around with sudo a bit and figure that out – Adam Rouzky Jun 16 '20 at 18:16
  • It worked! Thank you so so much – Adam Rouzky Jun 16 '20 at 18:27
  • Spoke too soon; it WAS working, and then I refreshed the page one too many times and now it's just a black screen. – Adam Rouzky Jun 16 '20 at 18:29
  • Is you webserver running on your raspberry pi? try restarting it and check, the webserver – tHeSiD Jun 16 '20 at 18:31
  • Tried that, I used "sudo service apache2 reload/restart" but it's still just a black screen – Adam Rouzky Jun 16 '20 at 18:48
  • Ctrl+f5 on the browser? Post some screenshots, cant really pinpoint without seeing anything, like you folder structure, etc – tHeSiD Jun 16 '20 at 18:50
  • Funny thing; I just noticed that the video does show up, it just takes like, 3 minutes to load for some reason. I think I'm willing to work with that. Thanks for your help! – Adam Rouzky Jun 16 '20 at 19:01

0 Answers0