1.1.0 • Published 6 years ago

universal-video-api v1.1.0

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

Universal Video Player API

This module provides a universal API for controlling YouTube, Vimeo, MediaElement.js, Plyr and Video Element players.

Supported Methods

  • play
  • pause
  • stop
  • mute
  • unmute

Supported Events

  • play
  • pause
  • ended

Install

npm install universal-vide-api --save-dev

Usage

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();
});
1.1.0

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago