0

I've been stuck trying to make a video on my computer be the video in the background. My video is titled "runbg.avi" and it is in the same folder as my HTML and CSS files.

These are a couple of many websites that I visited to search for an answer.

Using file:// instead of http:// when trying to get video from my computer rather than the web.

I can point to video on the web but not locally.

My program so far.

/* BACKGROUND */
video#vid {
position: fixed; 
right: 0; 
bottom: 0;
min-width: 100%; 
min-height: 100%;
width: auto; 
height: auto; 
z-index: -100;
background-size: cover;
margin: 0 auto;
}
<!DOCTYPE html>
<head>
<title>Seb's Fitness</title>

<link rel = "stylesheet"
      type = "text/css"
      href = "css.css" />

      <video autoplay loop poster="" id="vid">
    <source src="file://runbg.avi" type="video/avi">
    </video>
John Mann
  • 83
  • 1
  • 11

2 Answers2

0

EDIT: HTML5 video tag does not support AVI video types

You can use online video converter tool to convert to supported video type. MP4, OGG, WEBM

Does HTML5 <video> playback support the .avi format?

Matthew Hall
  • 131
  • 1
  • 5
0
<video autoplay loop poster="" id="vid">
    <source src="/runbg.avi" type="video/avi">
 </video>

/runbg.avi means start in the root folder (/) and then search runbh.avi file.

learn more relative and absolute paths

Lucas David Ferrero
  • 1,630
  • 14
  • 40