alisonmonteiro/youplay

Option to call with Javascript

Opened this issue · 0 comments

options object:

const element = document.querySelector('.video-example');
const options = {
  id: '3gxNW2Ulpwk',
  play: '.play', // default `.button-play`
  pause: '.pause-button', // default `.button-pause`
  stop: '.stop-video' // default `.button-stop`
};

youplay(element, options).init();

// Or just
youplay(element, options);

Methods:

const element = document.querySelector('.video-example');
const player = youplay(element);
const somethingHappens = true;

if (somethingHappens) {
  player.play();
} else {
  player.pause();
}