play pause html5 video javascript

后端 未结 8 1824
醉酒成梦
醉酒成梦 2020-12-01 10:24

I have a function that plays a video when I click on the poster image displayed in the player and it seems to work :

var video = document.getElementById(\'pl         


        
8条回答
  •  独厮守ぢ
    2020-12-01 11:07

    This is the easiest solution

    this.on("pause", function () {
        $('.vjs-big-play-button').removeClass(
            'vjs-hidden'
        ).css('display', 'block');
        this.one("play", function () {
            $('.vjs-big-play-button').addClass(
                'vjs-hidden'
            ).css('display', '');
        });
    });
    

提交回复
热议问题