I currently have a script that plays and pauses a video onclick.
What I would like to do is overlay a play button over the video at the start and when it is paused, and for that same button to disappear when the video plays again.
Any suggestions would be appreciated.
HTML
<video class="video"><source src="http://e14aaeb709f7cde1ae68-a1d0a134a31b545b257b15f8a8ba5726.r70.cf3.rackcdn.com/projects/31432/1427815464209-bf74131a7528d0ea5ce8c0710f530bb5/1280x720.mp4" type="video/mp4">
</video>
CSS
.video {
width: 50%;
border: 1px solid black;
}
JS
// Plays and pauses video on click
$('.video').click(function(){this.paused?this.play():this.pause();});
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…