Last active
August 29, 2015 14:08
-
-
Save felipesilva/ec785078fb09f53e9b3f to your computer and use it in GitHub Desktop.
VHS Plugin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The functions _play, _pause, _seeked, _ended are represented as player events