Search
 
SCRIPT & CODE EXAMPLE
 

HTML

html video

<video width="320" height="240" controls>
  <source src="your_video's_name.mp4" type="video/mp4">
  Error Message
</video>

<!-- i copied w3schools code lol-->
Comment

html5 video player

<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>
Comment

basic video player html

// basic video player html
<video class="video-container" controls muted autoplay loop>
  <source src="./video.mp4" type="video/mp4"/>
</video>
Comment

html 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>
Comment

html5 video player

<video width="320" height="240" controls>
  <source src="movie.mp4" type="video/mp4">
  <source src="movie.ogg" type="video/ogg">
</video>
Comment

html video player

<video> 
  <source src="path_to_your_video_file.mp4" type="video/mp4"> 
</video> 
Comment

html video play

var vid = document.getElementById("myVideo");

function playVid() {
    vid.play();
}

function pauseVid() {
    vid.pause();
}
Comment

PREVIOUS NEXT
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 
ADD CONTENT
Topic
Content
Source link
Name
7+4 =