播放暂停 防止报错

function playpauseToggle() {
    let isPlaying = video.currentTime > 0 && !video.paused && !video.ended && video.readyState > 2;
    if (!isPlaying) {
        $('.play img').attr('src', '../imgs/pause.svg');
        video.play();
    }
    else {
        $('.play img').attr('src', '../imgs/play.svg');
        video.pause();
    }
    return false;
}

你可能感兴趣的:(播放暂停 防止报错)