Skip to content

Instantly share code, notes, and snippets.

@gerbenvandijk
Created June 27, 2014 13:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gerbenvandijk/70b67af90996d0bb39ac to your computer and use it in GitHub Desktop.
Save gerbenvandijk/70b67af90996d0bb39ac to your computer and use it in GitHub Desktop.
Basic HTML5 video implementation
<video width="1920" height="1080" src="http://www.domain.com/assets/video/video.mp4" poster="http://www.domain.com/assets/img/poster.jpg" autoplay loop preload muted></video>
<!--
The above element behaves like this:
- Sets the width and height of the video element to 1920x1080 (can be overridden by CSS or even JS).
- Sets the source of the video to the URL of the video file.
- Sets a poster image to show before the video plays.
- Makes the video play automatically as soon as possible.
- Loops the video endlessly (unless it's paused by the user or programmatically).
- Preloads the entire video in the background.
- Does not give the user controls like play and pause.
- Mutes the video's audio.
-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment