JavaScript编程开发中基于jQuery的视频播放插件开发教程
javascript开发中基于jquery的视频播放插件开发教程。
代码如下:
<p class="report" id="play-product" style="cursor: pointer" data-flv="视频路径地址"></p>
<script type="text/javascript">
//播放视频
$('#play-product').click(function(){
var flvurl = $(this).attr('data-flv');
var close = 'closeplayer';
var box = 'playerbox';
var objclose = "#"+close;
var objbox = "#"+box;
$("body").append("<p id= "+box+"><p class='closetitle'><a href='javascript:;' id= "+close+">点击关闭</a></p><object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' width='100%' height='100%' id='index' align='middle'><param name='movie' value='/club/images/flvplayer.swf'><param name='quality' value='high'><param name='bgcolor' value='#000'><param name='play' value='true'><param name='loop' value='true'><param name='wmode' value='transparent'><param name='scale' value='showall'><param name='menu' value='true'><param name='devicefont' value='false'><param name='salign' value=''><param name='flashvars' value='flvurl="+flvurl+"'><param name='allowscriptaccess' value='samedomain'><param name='allowfullscreen' value='true'><!--[if !ie]>--><object type='application/x-shockwave-flash' data='/club/images/flvplayer.swf' width='100%' height='100%' align='middle'><param name='movie' value='/club/images/flvplayer.swf'><param name='quality' value='high'><param name='bgcolor' value='#000'><param name='play' value='true'><param name='loop' value='true'><param name='wmode' value='transparent'><param name='scale' value='showall'><param name='menu' value='true'><param name='devicefont' value='false'><param name='salign' value=''><param name='allowfullscreen' value='true'><param name='flashvars' value='flvurl="+flvurl+"'><param name='allowscriptaccess' value='samedomain'><!--<![endif]--><a href='https://www.adobe.com/go/getflash'><img src=https://www.2cto.com/uploadfile/2018/0115/20180115033947187.com/&' alt='取得 adobe flash 播放程式'></a><!--[if !ie]>--></object><!--<![endif]--></object></p>");
$(objclose).click(function(){
$(objbox).remove();
});
return false;
});
</script>
推荐阅读
-
JavaScript编程开发中jQuery的缓存机制浅析
-
JavaScript编程开发中基于jQuery的视频播放插件开发教程
-
JavaScript编程开发中jquery获取radio值实例教程
-
JavaScript编程开发中jquery中post方法用法实例教程
-
基于jQuery的弹出框插件开发教程
-
JavaScript编程开发中jQuery的text()方法用法分析
-
JavaScript编程开发中jquery队列函数用法实例教程
-
JavaScript编程开发之jQuery中的编程范式详解
-
JavaScript 编程开发中基于jQuery下拉框实现方法
-
基于FFmpeg的视频播放器开发系列教程(三)