html5 - Add vimeo style menu to video.js? -


i have simple demo page working video.js , haven't changed thing yet. have can hover on , see menu appear, way vimeo menu sharing etc.

i trying work out if should done on html / css side of things, or if there funcationality in video.js add menus. quick example great if there 1 online somewhere can linked to.

thanks in advance

one way use video.js ready event modify dom.

if inspect dom when ready event fires video.js instance, you'll notice video tag has been wrapped div, , id used has been transferred div.

if have enabled controls, you'll notice video element has sibling elements in new wrapper div. these controls video.js adds.

you can create additional controls, , add siblings video element (alongside ones video.js creates).

so, quick example (using jquery, although done without it):

var vimeomenu = '<ul id="vimeo"><li id="like"></li><li id="later"></li><li id="share"></li></ul>';  var videoid = "example_video";     var playerinstance = videojs(videoid).ready(function(){      // add elements dom     var playerwrapper = $("#" + videoid);     playerwrapper.append(videomenu); }); 

using css, can position controls in top right (like vimeo). video.js adds class wrapper element can use show / hide controls. default, hide elements (display, visibility, opacity, etc.). when class of instance changes .vjs-user-active, can show elements. video.js uses 1 second transition (if want match perfectly).


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

html - Repeat image to extend header to fill screen -

javascript - Backbone.js getting target attribute -