网上播放.flv格式的二种程序

本文提供了两种使用不同Flash组件嵌入网页视频播放器的方法,并附带了检查浏览器Flash版本的JavaScript函数。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

第一种:
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="360" height="270" VIEWASTEXT>

<param name="movie" value="VideoUpload/vcastr22.swf">

<param name="quality" value="high">

<param name="allowFullScreen" value="true" />

<param name="IsAutoPlay" value="1" />

<param name="FlashVars" value="vcastr_file=<%=Content%>.flv&IsAutoPlay=1" />

<embed src="VideoUpload/vcastr22.swf" allowFullScreen="true" FlashVars="vcastr_file=<%=Content%>.flv&IsAutoPlay=1" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="360" height="270"></embed>

</object>
第二种:
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="400" height="400" id="FLVPlayer1">

  <param name="movie" value="FLVPlayer_Progressive.swf" />

  <param name="salign" value="lt" />

  <param name="quality" value="high" />

  <param name="scale" value="noscale" />

  <param name="FlashVars" value="&MM_ComponentVersion=1&skinName=Clear_Skin_1&streamName=../19050b3a-cfb6-4526-a778-946a3fedc2b1&autoPlay=false&autoRewind=false" />

  <embed src="FLVPlayer_Progressive.swf" flashvars="&MM_ComponentVersion=1&skinName=Clear_Skin_1&streamName=../19050b3a-cfb6-4526-a778-946a3fedc2b1&autoPlay=false&autoRewind=false" quality="high" scale="noscale" width="400" height="400" name="FLVPlayer1" salign="LT" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />

</object>
在<head></head>中加入
<script type="text/javascript">

function MM_CheckFlashVersion(reqVerStr,msg){

  with(navigator){

    var isIE  = (appVersion.indexOf("MSIE") != -1 && userAgent.indexOf("Opera") == -1);

    var isWin = (appVersion.toLowerCase().indexOf("win") != -1);

    if (!isIE || !isWin){  

      var flashVer = -1;

      if (plugins && plugins.length > 0){

        var desc = plugins["Shockwave Flash"] ? plugins["Shockwave Flash"].description : "";

        desc = plugins["Shockwave Flash 2.0"] ? plugins["Shockwave Flash 2.0"].description : desc;

        if (desc == "") flashVer = -1;

        else{

          var descArr = desc.split(" ");

          var tempArrMajor = descArr[2].split(".");

          var verMajor = tempArrMajor[0];

          var tempArrMinor = (descArr[3] != "") ? descArr[3].split("r") : descArr[4].split("r");

          var verMinor = (tempArrMinor[1] > 0) ? tempArrMinor[1] : 0;

          flashVer =  parseFloat(verMajor + "." + verMinor);

        }

      }

      // WebTV has Flash Player 4 or lower -- too low for video

      else if (userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 4.0;



      var verArr = reqVerStr.split(",");

      var reqVer = parseFloat(verArr[0] + "." + verArr[2]);

  

      if (flashVer < reqVer){

        if (confirm(msg))

          window.location = "http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash";

      }

    }

  } 

}

		</script>
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值