video.js - VideoJS -- Best way to tie plugin to controlBar fadeIn -


i'm trying create plugin that'll add sharing button videojs player's overlay when user hovers on or pauses video -- want element fade in on player when controlbar show , fade out when it's hidden. hackish solution listen player's "controlsvisible" , "controlshidden" events , calling fadein/out on element when trigger.

is best hook have available, or there preferred method?

sample:

videojs.plugin('sharebuttons', function(options) {   var sharebtn;   sharebtn = $('<a href="#" id="player-share"><span class="icon-share"></span>share</a>');   sharebtn.click(function() {     return alert("share");   });   $(this.el()).append(sharebtn);   this.on("controlsvisible", function() {     return vjs.component.prototype.fadein.call($("#player-share"));   });   return this.on("controlshidden", function() {     return vjs.component.prototype.fadeout.call($("#player-share"));   }); }); 

i'm in process of updating this. can see css in branch here: https://github.com/heff/video-js/blob/feature/control-bar-fixes/src/css/video-js.less

you'll able use events (useractive/userpassive) or css classes (vjs-user-active/vjs-user-passive).


Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

How to get multiresult with multicondition in Sql Server -