jPlayer 利用 jQuery / Zepto 插件 + HTML5 媒体标签,对视频、音频进行播放。可以在网页中轻松展示播放视频或音频,并且给予播放器界面予以展示。jPlayer 支持文件格式有:HTML5:mp3, m4a (AAC), m4v (H.264), ogv, oga, wav, webm;Flash:mp3, m4a (AAC), m4v (H.264), rtmp, flv 等。内有丰富的例子。
Example-API:
//<![CDATA[ $(document).ready(function(){ var songs = [ {title : "Sexy Love - T-Ara", mp3 : "assets/T-Ara - Sexy Love.mp3"}, {title : "With Love - Christina Grimmie", mp3 : "assets/Christina Grimmie - With Love.mp3"}, {title : "Counting Stars - Christina Grimmie", mp3 : "assets/Christina Grimmie - Counting Stars.mp3"}, {title : "Liar Liar - Christina Grimmie", mp3 : "assets/Christina Grimmie - Liar Liar.mp3"}, {title : "Love Me Like You Do - Ellie Goulding", mp3 : "assets/Ellie Goulding - Love Me Like You Do.mp3"}, {title : "Slow Dancing In A Burning Room - John Mayer", mp3 : "assets/John Mayer - Slow Dancing In A Burning Room.mp3"}, {title : "In Love With A View - Mojave 3", mp3 : "assets/Mojave 3 - In Love With A View.mp3"}, {title : "Heart Of Gold - Neil Young", mp3 : "assets/Neil Young - Heart Of Gold.mp3"}, ]; new jPlayerPlaylist({ jPlayer: "#jquery_jplayer_2", cssSelectorAncestor: "#jp_container_2" }, songs, { swfPath: "libs/dist/jplayer", supplied: "oga, mp3", wmode: "window", useStateClassSkin: true, autoBlur: false, smoothPlayBar: true, keyEnabled: true }); }); //]]>