How do I make this into one button that toggles play/stop?
$('.play').click(function() {
$('#jquery-video').get(0).play();
});
$('.stop').click(function() {
$('#jquery-video').get(0).pause();
});
$('.toggle').click(function() {
if ($(this).hasClass('stopped')) {
console.log("stopped");
$(this).removeClass("stopped");
$(this).addClass("playing");
}
else {
console.log("playing");
$(this).removeClass("playing");
$(this).addClass("stopped");
}
});
</script>