开发者

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:

  1. include the javascript

  2. add your video tag: <video src="path-to-youtube-site/watch?v=siOHh0uzcuY"></video>

  3. 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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜