$('#play-pause-button').click(function () {
var mediaVideo = $("#media-video").get(0);
if (mediaVideo.paused) {
mediaVideo.play();
} else {
mediaVideo.pause();
}
});
I have done this in jQuery, which is simple and fast. To try it, you just need to use the ID of the video tag and your play/pause button.
EDIT:
In vanilla JavaScript:
a video is not a function, but part of DOM hence use
video.play();
Instead of
video().play() **wrong**