Question

I'm making a portfolio at the moment, and I want an mp4 file running in the background.. I know how to get it to loop & repeat, but apparently i can't figure out how to do it at the same time..

Here is the code I'm trying to do it with

 <div class="wrapper">
    <div class="screen" id="screen-1" data-video="vid/NycTrafficH264.mp4">
        <h1 class="video-title">#K Designs</h1>
        <!--for Video autoplay-->
        <video controls autoplay>
            <source src="vid/NycTrafficH264.mp4" type="video/mp4">
            <source src="movie.ogg" type="video/ogg">
        </video>
        <!--For video loop-->
        <video controls loop>
            <source src="vid/NycTrafficH264.mp4" type="vid/NycTrafficH264.mp4">
            <source src="movie.ogg" type="video/ogg">
        </video> 
    </div>
</div>
Était-ce utile?

La solution

You just need to add the loop attribute to the same node. Try the below code:

<video controls autoplay loop>
<source src="vid/NycTrafficH264.mp4" type="video/mp4">
<source src="movie.ogg" type="video/ogg">
</video>

I hope this is what you are looking for.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top