我的网页上有视频背景,我想将此视频停止3-4秒,然后继续(循环播放)。我该怎么办?
我有此代码:
var data = _dbContext.Project
.Select(p => new ProjectViewModel
{
Id = p.Id,
Details = p.ProjectDetails
.Select(pd => new KeyValuePair<string, List<string>>(pd.DetailDescription, pd.ProjectDetailsAnswers.Select(pda => pda.AnswerDescription).ToList()))
.ToList()
})
.ToList();
答案 0 :(得分:0)
以下是使用JavaScript的示例:
const video = document.getElementById('myVideo');
video.currentTime = 5; // Video will jump to 5th second
video.pause();
setInterval(() => {
video.play();
}, 3000);
<video id="myVideo" autoplay loop>
<source src="https://www.w3schools.com/jsref/movie.mp4" type="video/mp4">
<source src="https://www.w3schools.com/jsref/movie.ogg" type="video/ogg">
Your browser does not support the video tag.
</video>