0

I have a playbutton on my HTML5 video that makes my video play and go into fullscreen mode. This is the code for that:

var video = $("#vid");
var playthis = $(".play");
playthis.on('click', function(e){
    var vid = video[0];
    vid.play();
    if (vid.requestFullscreen) {
      vid.requestFullscreen();
    } else if (vid.mozRequestFullScreen) {
      vid.mozRequestFullScreen();
    } else if (vid.webkitRequestFullscreen) {
      vid.webkitRequestFullscreen();
    }
});

What I want to do is to check if my video is playing already, and then hide the play-button. If the video is stopped or paused it should be shown.

Should be easy but it's something that goes wrong.

Henric Åkesson
  • 140
  • 1
  • 2
  • 11

0 Answers0