jquery设置video的宽度_jquery html5 视频播放控制代码
jQuery HTML5 視頻播放控制核心代碼:
您的瀏覽器不支持html5!
$('video').click(function() {
if ($(this).hasClass('pause') ) {
$("video").trigger("play");
$(this).removeClass('pause');
$(this).addClass('play');
} else {
$("video").trigger("pause");
$(this).removeClass('play');
$(this).addClass('pause');
}
});
如果想正式用戶播放環境,建議大家使用jplayer之類的工具
//
$(document).ready(function(){
$("#jquery_jplayer_1").jPlayer({
ready: function (event) {
$(this).jPlayer("setMedia", {
title: "Bubble",
m4a: "http://jplayer.org/audio/m4a/Miaow-07-Bubble.m4a",
oga: "http://jplayer.org/audio/ogg/Miaow-07-Bubble.ogg"
});
},
swfPath: "../../dist/jplayer",
supplied: "m4a, oga",
wmode: "window",
useStateClassSkin: true,
autoBlur: false,
smoothPlayBar: true,
keyEnabled: true,
remainingDuration: true,
toggleDuration: true
});
});
//]]>
jPlayer是一個JavaScript寫的完全免費和開源 (MIT) 的jQuery多媒體庫插件 (現在也是一個Zepto插件) jPlayer可以讓你迅速編寫一個跨平臺的支持音頻和視頻播放的網頁. jPlayer的豐富API可以讓你創建一個個性化多媒體應用,因此也獲得越來越多的社區成員的支持和鼓勵。
總結
以上是生活随笔為你收集整理的jquery设置video的宽度_jquery html5 视频播放控制代码的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: python ansible模块_ans
- 下一篇: python实现决策树数据直接赋值导入_