このコードでは、ビデオのループ可能な部分を2つ設定できるため、開始するには十分な解決策が必要です。 jQueryベースではありませんが、そのモデルに変換するには簡単です(手作業ではない)
<video id="video" controls="controls" muted preload="metadata" >
<source src="video.mp4" type="video/mp4" />
</video>
<button onclick="repeat(1,3)">1-3</button>
<button onclick="repeat(5,7)">5-7</button>
<script>
var funcLoop
function repeat(startTime, endTime) {
var video = document.getElementById('video');
video.removeEventListener('timeupdate', funcLoop, false);
video.addEventListener('timeupdate', funcLoop=function(){
if (video.currentTime < startTime) {
video.currentTime = startTime;
}
if (video.currentTime >= endTime) {
video.currentTime = startTime;
}}, false);
video.play();
}
</script>
ここにコードを追加してください。 – RRK
あなたはどこにいるのですか? –
'ontimeupdate'イベントがあります。価値のある読書 – RRK