<video width="320" height="240" controls>
<source src="your_video's_name.mp4" type="video/mp4">
Error Message
</video>
<!-- i copied w3schools code lol-->
<video width="320" height="240" controls>
<source src="movie.mp4" type="video/mp4">
<source src="movie.ogg" type="video/ogg">
Your browser does not support the video tag. <!-- Text to be shown incase browser doesnt support html5 -->
</video>
// basic video player html
<video class="video-container" controls muted autoplay loop>
<source src="./video.mp4" type="video/mp4"/>
</video>
<div id='home-video' class="dl-neon-vid"><center>
<video playsinline loop muted autoplay width="100%">
<source src="video-link" />
</video></center>
</div>
<!-- script to pause ALL VIDEOS ON THE HOME PAGE when out of viewport -->
<script>
let options = {
root: null,
rootMargin:'0px',
threshold:1.0
};
let callback = (entries, observer)=>{
entries.forEach(entry => {
if(entry.target.id == 'home-video')
{
if(entry.isIntersecting){
entry.target.play();
}
else{
entry.target.pause();
}
}
});
}
let observer = new IntersectionObserver(callback, options);
observer.observe(document.querySelector('#home-video'));
</script>
<video width="320" height="240" controls>
<source src="movie.mp4" type="video/mp4">
<source src="movie.ogg" type="video/ogg">
</video>
<video>
<source src="path_to_your_video_file.mp4" type="video/mp4">
</video>
var vid = document.getElementById("myVideo");
function playVid() {
vid.play();
}
function pauseVid() {
vid.pause();
}
Code Example |
---|
Html :: html position div inside div |
Html :: center class in html |
Html :: comment a div in html |
Html :: form example |
Html :: button bootstrap |
Html :: markup embed youtube |
Html :: placeholder text html |
Html :: markdown to html |
Html :: html table |
Html :: tag img |
Html :: birthday wishes using html code |
Html :: radio buttons |
Html :: captcha code |
Html :: javascript popup form |
Html :: youtube autoplay |
Html :: react-render-html |
Html :: html form detached submit button |
Html :: path in html |
Html :: tailwind negative margin |
Html :: html how to play gifs |
Html :: form controller in bootstrap |
Html :: watermark in html5 |
Html :: input type tel |
Html :: align button on bottom of div |
Html :: bootstrap btn colors |
Html :: nested columsn inside bootstrap |
Html :: how to detect play button on html video player |
Html :: date month year dropdown html |
Html :: cards in html |
Html :: color selector html |