var video22 = document.getElementById("video22");var intervalID = null;var time = 0;var speed = 15; video22.onloadedmetadata = function() { var duration = video22.duration; intervalID = setInterval(function(){ time++; if (time / speed <= duration){ video22.currentTime = time / speed; }else{ clearInterval(intervalID); intervalID = null; } },1000 / speed); }; video22.addEventListener('click', function(){ clearInterval(intervalID); intervalID = null; this.play(); });
想問一下這個
如果這個code如果有很多視頻
我該如何簡化呢
因為這樣有幾個視頻就要幾段這樣的code
肥皂起泡泡
相关分类