Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

HTML

Jonathan Sebastiao
Jonathan Sebastiao
14,271 Points

HTML Video Source

Hello,

I am curious on what is the best method on uploading a video and using the link for the video source. I know I could upload to Vimeo but I only want the video to be viewed on my website as a background image (video). I have siteground as my host and if I upload through FTP how may I find that file link?

1 Answer

You could upload it it on your server and do something like:

<video autoplay loop poster="polina.jpg" id="bgvid">
    <source src="polina.webm" type="video/webm">
    <source src="polina.mp4" type="video/mp4">
</video>

with the css:

video#bgvid {
    position: fixed; right: 0; bottom: 0;
    min-width: 100%; min-height: 100%;
    width: auto; height: auto; z-index: -100;
    background: url(polina.jpg) no-repeat;
    background-size: cover;
}

You can read http://demosthenes.info/blog/777/Create-Fullscreen-HTML5-Page-Background-Video