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
function myFunction(){
var playVideo = document.getElementById('myVideo');
var button = document.getElementById('myBtn');
if (playVideo.paused) {
playVideo.play();
button.innerHTML= "pause";
} else {
button.innerHTML= "play";
playVideo.pause();
}
};
$('#video-id').click(function() {
// jQuery sets this as the DOM element that triggered the event
// no need to wrap it in jQuery $(this) and unwrap it again $(this).get(0)
if (this.paused) {
this.play();
} else {
this.pause();
}
});