Skip to content

Instantly share code, notes, and snippets.

@felipesilva
Last active August 29, 2015 14:08
Show Gist options
  • Save felipesilva/ec785078fb09f53e9b3f to your computer and use it in GitHub Desktop.
Save felipesilva/ec785078fb09f53e9b3f to your computer and use it in GitHub Desktop.
VHS Plugin
VHS.plugin('name_your_plugin', {
_initialize: function(){
//method is called when the player is ready and the plugin was registered
this._player //player instance
this._options //options used to configure the player
this._element //jQuery element: video tag or object tag
this._data //video data that comes from the internal video/playlist api
this._container //player wrapper jquery element
},
yourMethod: function(e){
console.log(e);
},
_play: function(){
this.yourMethod('play');
},
_pause: function(){
this.yourMethod('pause');
},
_seeked: function(position){
this.yourMethod('seeked');
},
_ended: function(){
this.yourMethod('ended');
}
});
@dayvson
Copy link

dayvson commented Nov 4, 2014

The functions _play, _pause, _seeked, _ended are represented as player events

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment