当前位置:网站首页>H5 video automatic playback and circular playback

H5 video automatic playback and circular playback

2022-06-26 13:14:00 Collect and learn by yourself

<video id="audio" class="video-player" loop="loop" autoplay muted >
        <source src="/static/images/h5/activity/hea/video.mp4?2" type="video/mp4">
</video>

Jq:

Change video address

$('#audio').html('');

var src = "<source src=\"" + info.videoUrl + "\" type=\"video/mp4\">";

$('#audio').append(src);
var video = document.getElementById("audio");
video.loop = false;
video.addEventListener('ended', function() {
    video.currentTime=0.1; video.play(); }, false);
video.play();

原网站

版权声明
本文为[Collect and learn by yourself]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/177/202206261227062750.html