In code shown below overlay function is not called.
(function(jwplayer) {
var overlay = function( player, config, div ) {
console.log('hi');
}
jwplayer().registerPlugin( 'overlay','2.0', overlay );
})(jwplayer);
Please help me with it. Also I am not recieving any errors on console.
Thanks @jherrieven for guiding me.
In order to add plugin to JW player. Below are the steps:
Sign up to jw player and include JS file from there in HTML file. Publish > Tools.
Setup video and embed it in HTML page. Note here in jwplayer().setup() function we have added our plugin that we need to associate with our player.
<script> jwplayer("myDiv").setup({ "file": "file.mp4", "image": "myImage.png", "height": 360, "width": 640, plugins: { 'customPlugin.js': { "key": "helloworld" } } }); </script>
Now in customPlugin.js file register your plugin.
(function (jwplayer) { var pluginCallback = function(player, config, div) { console.log(config.key); }; jwplayer().registerPlugin('customPlugin', '7.0', pluginCallback); })(jwplayer);
Output on console is helloworld.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.