欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

JavaScript编程开发中基于jQuery的视频播放插件开发教程

程序员文章站 2022-06-19 18:55:03
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>