Javascript:视频结束后页面不向下滚动

Javascript:视频结束后页面不向下滚动

ended函数放入setInterval

function video_close_timer() {
    var videoTimer = 1000; // Check if the video ended every second
    var timerId = undefined; // The ID of the Interval
    timerId = setInterval(function() {
        if (video_closed_scrollPlay()) {
            clearInterval(timerId);
            timerId = undefined;
        };
    }, videoTimer);
};

function video_has_closed() {
    if (vid.currentTime >= vid.duration) {
        window.scrollTo(0, 1000);
        return true;
    };
    return false;
};

function video_closed_scrollPlay() {
    var result = video_has_closed();
    scrollPlay();
    return result;
};

function ended() {
    return video_closed_scrollPlay();
};

video_close_timer视频开始时调用该函数。

Javascript:视频结束后页面不向下滚动

相关文章:

你感兴趣的文章:

标签云: