how to add a youtube video to / with jMediaelement
Does anybody uses jMediaelement (http://protofunc.com/jme/index.html) for HTML5 videos? I am wondering how to display a youtube video. I see there's a demo on the homepage of jMediaelement, but the source code开发者_StackOverflow社区 is not provided (clever!). Any idea how to? Thanks
the starter-code of all demos are provided as inline-javascript. If you download the dev-bundle package, there is also a youtube demo, including a playlist example: demos/more-examples/9-playlist-youtube.html
All you have to do is:
include the javascript
add your video tag: <video src="path-to-youtube-site/watch?v=siOHh0uzcuY"></video>
call the js method on domready:
// either (for predefined non-stylable controls): $('video').jmeEmbed(); //try this first if you have any problems
// or (if you want to use custom stylable and writeable controls): $('video').jmeControl();
// or (if you want to style, but not write): $('video').jmeEmbedControls();
Note also that, you have to add your swf/html to the local trusted sandbox and/or test in an http-enviroment: http://protofunc.com/jme/documentation/documentation-faq.html
regards alex
精彩评论