首页 > 代码库 > 视频预览

视频预览

利用本地播放器ckplayer
 $(‘.js_vodImgList‘).on(‘click‘,‘.preview‘, function(){
                var urls = $(this).attr("urls");
                var format = $(this).attr("format");
                layer.open({
                    type: 2,
                    title: false,
                    area: [‘630px‘, ‘360px‘],
                    shade: 0.8,
                    closeBtn: 0,
                    shadeClose: true,
                    content: ‘SP_preview.do?urls=‘+urls+‘&format=‘+format
                });
            });
----------------------------------------------------------------------
<li><a href="javascript:;" class="preview" urls="${map.videoUrl}" format="${map.format}" title="预览"></a></li>
--------------------------------------------------
<div class="paly-iframe">
     <div class="btn">
       <i class="voice"></i>
     </div>
       <#if urls?? && format??>
       <p style="margin: 5px auto; text-align: center">
           <#if format==‘FLV‘>
           <object height="300" width="98%" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000">
               <param name="movie" value="http://www.mamicode.com/${base}/r/cms/www/default/img/flvplayer.swf" />
               <param name="quality" value="http://www.mamicode.com/high" />
               <param name="allowFullScreen" value="http://www.mamicode.com/true" />
               <param name="FlashVars" value="http://www.mamicode.com/vcastr_file=${base}/${urls!}&BufferTime=3" /><embed height="500" width="98%" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" quality="high" flashvars="vcastr_file=${base}/${urls!}" allowfullscreen="true" src="http://www.mamicode.com/${base}/r/cms/www/default/img/flvplayer.swf"></embed>
           </object>
           <#elseif format==‘FLASH‘>
           <embed height="500" width="98%" type="application/x-shockwave-flash" quality="high" src="http://www.mamicode.com/${base}/${urls!}" wmode="transparent" align="center"></embed>
           <#elseif format==‘CK‘>
           <!--ckplayer播放视频-->
       <div id="video" style="position:relative;z-index: 100;width:850px;height:500px;float: left;"><div id="a1"></div></div>
       <script type="text/javascript">
           //函数名称不允许更改 function ckmarqueeadv(){return ‘广告内容‘};
           var flashvars={
               f:‘${urls!}‘,
               c:0,
               b:1,
               p:1,
               st:1,
               fc:1,
               i:‘‘,
               my_url:‘‘,
               my_pic:‘‘
           };
           var video=[‘${urls!}->video/mp4‘];
           CKobject.embed(‘${resSys}/ckplayer/ckplayer.swf‘,‘a1‘,‘ckplayer_a1‘,‘850‘,‘500‘,false,flashvars,video);
           var box = new LightBox();
           function closelights(){//关灯
               box.Show();
           }
           function openlights(){//开灯
               box.Close();
           }
       </script>
       <#else>
       <embed height="500" width="98%" type="video/x-ms-wmv" src="http://www.mamicode.com/${base}/${urls}" console="cons" controls="ImageWindow" autostart="true"></embed>
       </#if>
       </p>
       </#if>
   </div>

 

视频预览