nl_tokens: Takes a basic plugin function and returns a wrapper function which marks on the player that the plugin has been activated .
pl_tokens: function createBasicPlugin ( name , plugin ) { var basicPluginWrapper = function basicPluginWrapper ( ) { // We trigger the "beforepluginsetup" and "pluginsetup" events on the player // regardless, but we want the hash to be consistent with the hash provided // for advanced plugins. // // The only potentially counter-intuitive thing here is the `instance` in // the "pluginsetup" event is the value returned by the `plugin` function. triggerSetupEvent ( this , { name : name , plugin : plugin , instance : null } , true ) ; var instance = plugin . apply ( this , arguments ) ; markPluginAsActive ( this , name ) ; triggerSetupEvent ( this , { name : name , plugin : plugin , <mask> : instance } ) ; return instance ; } ; Object . keys ( plugin ) . forEach ( function ( prop ) { basicPluginWrapper [ prop ] = plugin [ prop ] ; } ) ; return basicPluginWrapper ; }