फुल-स्क्रीन वीडियो बैकग्राउंड के लिए position: fixed, min-width: 100%, min-height: 100% उपयोग करें। कंटेंट ओवरले के लिए rgba पारदर्शिता, और प्ले/पॉज़ बटन जावास्क्रिप्ट से नियंत्रित होता है।
उदाहरण
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style>
* { box-sizing: border-box; }
body { margin: 0; font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; font-size: 17px; }
.backgroundVideo {
position: fixed; right: 0; bottom: 0;
min-width: 100%; min-height: 100%;
}
.content {
position: fixed; bottom: 0;
background: rgba(0, 0, 0, 0.5); color: #f1f1f1;
width: 100%; padding: 20px;
}
.playPauseBtn {
width: 200px; font-size: 18px; padding: 10px;
border: none; background: rgb(72, 22, 167);
color: #fff; cursor: pointer; opacity: 0.8;
}
.playPauseBtn:hover { opacity: 1; }
</style>
</head>
<body>
<video autoplay muted loop class="backgroundVideo">
<source src="https://cdn.videvo.net/videvo_files/video/free/2019-05/small_watermarked/190416_10_Drone1_04_preview.webm" type="video/mp4"/>
</video>
<div class="content">
<h1>Heading</h1> <h2>Some Sample text</h2>
<button class="playPauseBtn">Pause</button>
</div>
<script>
document.querySelector(".playPauseBtn").addEventListener("click", toggleVideo);
var video = document.querySelector(".backgroundVideo");
var btn = document.querySelector(".playPauseBtn");
function toggleVideo() {
if (video.paused) { video.play(); btn.innerHTML = "Pause"; }
else { video.pause(); btn.innerHTML = "Play"; }
}
</script>
</body>
</html>
आउटपुट
उपरोक्त कोड निम्नलिखित आउटपुट उत्पन्न करेगा:

मुख्य बिंदु
- video एट्रिब्यूट - autoplay, muted, loop (ब्राउज़र नीति अनुपालन)
- position: fixed - व्यूपोर्ट के सापेक्ष स्थिर
- min-width/height 100% - पूरे व्यूपोर्ट को कवर
- rgba ओवरले - कंटेंट पठनीयता के लिए
- JS टॉगल - play()/pause() और बटन टेक्स्ट अपडेट
- z-index लेयरिंग - वीडियो पीछे, कंटेंट आगे