 
  Data Structure Data Structure
 Networking Networking
 RDBMS RDBMS
 Operating System Operating System
 Java Java
 MS Excel MS Excel
 iOS iOS
 HTML HTML
 CSS CSS
 Android Android
 Python Python
 C Programming C Programming
 C++ C++
 C# C#
 MongoDB MongoDB
 MySQL MySQL
 Javascript Javascript
 PHP PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How can I add video to site background in HTML 5?
Add a button to play or pause the video. Then we have styled the video to a hundred percentage height and width so that it covers the entire background.
The following is the code snippet to set video as a site background in HTML5.
<video autoplay muted loop id = "myVideo"> <source src = "demo.mp4" type = "video/mp4"> Your browser does not support HTML5 video. </video>
The following is to pause the video −
function display() {    if (video.paused) {       video.play();       btn.innerHTML = "Pause the video!";    } else {       video.pause();       btn.innerHTML = "Play";    } }Advertisements
 