最近在做一个项目,需要一个在线视频播放的功能,在度娘上找了许多都不是太理想,就动手写了一个,分享给大家
最近写了一个在线视频播放的功能,感觉这个插件还可以,和大家分享一下!
复制代码 代码如下:
<div data-flv="视频路径地址"></div>
<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("<div id= "+box+"><div><a href='javascript:;' id= "+Close+">点击关闭</a></div><object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000'><param value='/club/images/flvPlayer.swf'><param value='high'><param value='#000'><param value='true'><param value='true'><param value='transparent'><param value='showall'><param value='true'><param value='false'><param value=''><param value='flvURL="+flvUrl+"'><param value='sameDomain'><param value='true'><!--[if !IE]>--><object type='application/x-shockwave-flash' data='/club/images/flvPlayer.swf'><param value='/club/images/flvPlayer.swf'><param value='high'><param value='#000'><param value='true'><param value='true'><param value='transparent'><param value='showall'><param value='true'><param value='false'><param value=''><param value='true'><param value='flvURL="+flvUrl+"'><param value='sameDomain'><!--<![endif]--><a href='https://www.adobe.com/go/getflash'><img src='https://www.adobe.com/images/shared/download_buttons/get_flash_player.gif' alt='取得 Adobe Flash 播放程式'></a><!--[if !IE]>--></object><!--<![endif]--></object></div>");
$(objclose).click(function(){
$(objBox).remove();
});
return false;
});
</script>
您可能感兴趣的文章: