Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

video as background not loading

If I use the src from the web with src="http........" it works but it doesn't work if src is uploaded from my computer?

I tried this code:

 <video autoplay loop muted>
    <source src="../documents/Sent files/VID-20190106-WA0001.mp4" type="video/mp4"/> 
 </video>

and I also tried this code"

 <video autoplay loop playsinline muted src="../../documents/Sent files/VID-20190106-WA0001.mp4" type="video/mp4">
 </video>

but this works:

<video src="https://css-tricks-post-videos.s3.us-east- 
 1.amazonaws.com/708209935.mp4" autoplay loop playsinline muted></video>
like image 692
Ramzi Osta Avatar asked Mar 07 '26 23:03

Ramzi Osta


1 Answers

if html file and video file are in same directory you must set src without "../"

enter image description here

like image 163
Samuel Mazahery Avatar answered Mar 10 '26 14:03

Samuel Mazahery