This module provides a universal API for controlling YouTube, Vimeo, MediaElement.js, Plyr and Video Element players.
- play
- pause
- stop
- mute
- unmute
- play
- pause
- ended
npm install universal-vide-api --save-dev
const video = document.getElementById("video");
const videoElement = new VideoElement(video);
videoElement.setup(() => {
// events
videoElement.on("play", () => console.log("play"));
videoElement.on("pause", () => console.log("pause"));
videoElement.on("ended", () => console.log("ended"));
// methods
videoElement.play();
videoElement.pause();
videoElement.stop();
videoElement.mute();
videoElement.unmute();
});