/slant-player

Slant video player component

Primary LanguageJavaScriptMIT LicenseMIT

slant-player

Slant video player component.

screenshot

install

$ component install littlstar/slant-player

usage

var Player = require('slant-player');
var el = document.querySelector('#player');
var player = new Player(el, {src: 'video.mp4'});

player.render();

api

Player (parent, opts)

new Player(parent, {src: 'video.mp4'});
  • parent - Parent DOM Element
  • opts - Player options where an option is:
    • width - player width
    • height - player height
    • src - Video source
    • controls - slant-controls options

#play

Plays the video player

player.play();

#pause

Pauses the video player

player.pause();

#volume(level)

Sets the video player volume level

player.volume(0.8);

#mute

Muts the video player volume

player.mute();

#seek(seconds)

Seek to position in seconds

player.seek(34);

#use(fn)

Use a plugin with the player

player.use(plugin());

#show

Shows the video player

player.show();

#hide

Hides the video player

player.hide();

#render

Renders the video player in the DOM

player.render();

#destroy

Destroys the video player in view

player.destroy();

license

MIT