HTML5视频快速前进幻灯片



我正在尝试创建一个类似幻灯片的视频,如果您单击"快进"按钮,则会在视频中进入一定时间。(和倒带等。)视频是一个长视频,所以如果当前时间小于我已经实现的暂停标记,我只是想让它跳到一定时间。

这是我的JavaScript

function Fwd(){
        if (video.currentTime < 17.91)
        { video.play(17.91)
        }
        if ( video.currentTime < 35.93 && video.currentTime > 17.91)
        { video.play(35.93)
        }
    }

这在我的html中&lt;输入type =" button" value ="►►"(减去输入前的空间)

该按钮将从17.91秒开始播放下一个场景,当时它将播放17.91秒时,但仅此时。如果时间少于此,它不会跳到17.91。

请帮忙。我是JavaScript的新手!谢谢!

好的,所以这有效,但我仍然需要弄清楚如何使其进入自动播放:

function Fwd(){
    if (video.currentTime <= 17.91 && video.currentTime >= 0)
    { (video.currentTime = 17.92)
    }
    else if (video.currentTime <= 35.93 && video.currentTime > 17.91)
    { (video.currentTime = 35.94)
            }}

更新:在此处找到的自动播放解决方案:跳到html5视频中的当前时间后

最新更新