首页 > 代码库 > 如何在asp.net中如何在线播放各类视频文件

如何在asp.net中如何在线播放各类视频文件

一。后台拼字符串动态加载写法前台调用代码<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">< html xmlns="http://www.w3.org/1999/xhtml" >< head id="Head1" runat="server">    <title>视频播放</title>< /head>< body>    <form id="form1" runat="server">    <div>    <table>      <tr>        <td><div id="video_content" runat="server" style=""></div>     </td>      </tr>    </table>    </div>    </form>< /body>< /html>后台调用代码protected void Page_Load(object sender, EventArgs e)    {        this.video_content.InnerHtml = PlayMedia.Play("http://hot.tudou.com/flv/005/680/205/5680205.flv", 472,385);      }视频播放类:using System;using System.Collections.Generic;using System.Text;namespace Common{    public class PlayMedia    {        public PlayMedia()        {            //                //   TOD   在此处添加构造函数逻辑                //            }        public static string Play(string url, int width, int height)        {            string strTmp = url.ToLower();            if (strTmp.EndsWith(".wmv") || strTmp.EndsWith(".mp3") || strTmp.EndsWith(".wma") || strTmp.EndsWith(".avi") || strTmp.EndsWith(".asf") || strTmp.EndsWith(".mpg"))            {                return wmv(url, width, height);            }            else if (strTmp.EndsWith(".mp3"))            {                return mp3(url, width, height);            }            else if (strTmp.EndsWith(".swf"))            {                return swf(url, width, height);            }            else if (strTmp.EndsWith(".flv"))            {                return flv(url, width, height);            }            else if (strTmp.EndsWith(".jpg") || strTmp.EndsWith(".gif"))            {                return img(url, width, height);            }            else if (strTmp.EndsWith(".rm"))            {                return rm(url, width, height);            }            else            {                return "视频文件数据错误";            }        }        ///   <summary>            ///   flv格式文件播放            ///   </summary>            ///   <param   name="url"></param>            ///   <returns></returns>            private static string flv(string url, int width, int height)        {            System.Text.StringBuilder sb = new System.Text.StringBuilder();            sb.Append("<object   codeBase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,22,87\"   ");            sb.Append("classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" ");            sb.Append(" height=\"" + height + "\"   width=\"" + width + "\"   >");            sb.Append("<param   name=\"FlashVars\"   value=http://www.mamicode.com/"vcastr_file="+ url +"&LogoText=www.um173.com&BufferTime=3\">");            sb.Append("<param   name=\"Movie\"   value=http://www.mamicode.com/"\">");                        sb.Append("<param   name=\"allowFullScreen\"   value=http://www.mamicode.com/"true\">");            sb.Append("<param   name=\"WMode\"   value=http://www.mamicode.com/"Window\">");            sb.Append("<param   name=\"Play\"   value=http://www.mamicode.com/"1\">");            sb.Append("<param   name=\"Loop\"   value=http://www.mamicode.com/"-1\">");            sb.Append("<param   name=\"Quality\"   value=http://www.mamicode.com/"High\">");            sb.Append("<param   name=\"SAlign\"   value=http://www.mamicode.com/"\">");            sb.Append("<param   name=\"Menu\"   value=http://www.mamicode.com/"0\">");            sb.Append("<param   name=\"Base\"   value=http://www.mamicode.com/"\">");            sb.Append("<param   name=\"AllowScriptAccess\"   value=http://www.mamicode.com/"always\">");            sb.Append("<param   name=\"Scale\"   value=http://www.mamicode.com/"ShowAll\">");            sb.Append("<param   name=\"DeviceFont\"   value=http://www.mamicode.com/"0\">");            sb.Append("<param   name=\"EmbedMovie\"   value=http://www.mamicode.com/"0\">");            sb.Append("<param   name=\"BGColor\"   value=http://www.mamicode.com/"\">");            sb.Append("<param   name=\"SWRemote\"   value=http://www.mamicode.com/"\">");            sb.Append("<param   name=\"MovieData\"   value=http://www.mamicode.com/"\">");            sb.Append("<param   name=\"SeamlessTabbing\"   value=http://www.mamicode.com/"1\">");            sb.Append("<param   name=\"Profile\"   value=http://www.mamicode.com/"0\">");            sb.Append("<param   name=\"ProfileAddress\"   value=http://www.mamicode.com/"\">");            sb.Append("<param   name=\"ProfilePort\"   value=http://www.mamicode.com/"0\">");            sb.Append("<embed   src=http://www.mamicode.com/"\" flashvars=\"vcastr_file="+ url +"&LogoText=www.um173.com\"   height=\"" + height + "\"   width=\"" + width + "\"   quality=\"high\"   pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\"   menu=\"false\">");             sb.Append("</embed>");            sb.Append("</object>");            return sb.ToString();        }                           ///   <summary>            ///   wmv格式文件播放            ///   </summary>            ///   <param   name="url"></param>            ///   <returns></returns>          private static string wmv(string url, int width, int height)        {            System.Text.StringBuilder sb = new System.Text.StringBuilder();            sb.Append("<object   id=\"WMPlay\"   style=\"WIDTH:   " + width + "px;height:" + height + "px\"   \n");            sb.Append("classid=\"CLSID:6BF52A52-394A-11D3-B153-00C04F79FAA6\"   type=application/x-oleobject   standby=\"Loading   Windows   Media   Player   components...\"");            sb.Append("codebase=\"downloads/mediaplayer9.0_cn.exe\"   VIEWASTEXT>\n");            sb.Append("<param   name=\"URL\"   value=http://www.mamicode.com/‘" + url + "‘>\n");            sb.Append("<param   name=\"controls\"   value=http://www.mamicode.com/"ControlPanel,StatusBa\">");            //<param   name="CONTROLS"   VALUE="http://www.mamicode.com/ControlPanel,StatusBar">                sb.Append("<param   name=\"hidden\"   value=http://www.mamicode.com/"1\">");            sb.Append("<param   name=\"ShowControls\"   value=http://www.mamicode.com/"0\">");            sb.Append("<param   name=\"rate\"   value=http://www.mamicode.com/"1\">\n");            sb.Append("<param   name=\"balance\"   value=http://www.mamicode.com/"0\">\n");            sb.Append("<param   name=\"currentPosition\"   value=http://www.mamicode.com/"-1\">\n");            sb.Append("<param   name=\"defaultFrame\"   value=http://www.mamicode.com/"\">\n");            sb.Append("<param   name=\"playCount\"   value=http://www.mamicode.com/"100\">\n");            sb.Append("<param   name=\"autoStart\"   value=http://www.mamicode.com/"-1\">\n");            sb.Append("<param   name=\"currentMarker\"   value=http://www.mamicode.com/"0\">\n");            sb.Append("<param   name=\"invokeURLs\"   value=http://www.mamicode.com/"-1\">\n");            sb.Append("<param   name=\"baseURL\"   value=http://www.mamicode.com/"\">\n");            sb.Append("<param   name=\"volume\"   value=http://www.mamicode.com/"85\">\n");            sb.Append("<param   name=\"mute\"   value=http://www.mamicode.com/"0\">\n");            sb.Append("<param   name=\"uiMode\"   value=http://www.mamicode.com/"mini\">\n");            sb.Append("<param   name=\"stretchToFit\"   value=http://www.mamicode.com/"0\">\n");            sb.Append("<param   name=\"windowlessVideo\"   value=http://www.mamicode.com/"0\">\n");            sb.Append("<param   name=\"enabled\"   value=http://www.mamicode.com/"-1\">\n");            sb.Append("<param   name=\"enableContextMenu\"   value=http://www.mamicode.com/"false\">\n");            sb.Append("<param   name=\"fullScreen\"   value=http://www.mamicode.com/"0\">\n");            sb.Append("<param   name=\"SAMIStyle\"   value=http://www.mamicode.com/"\">\n");            sb.Append("<param   name=\"SAMILang\"   value=http://www.mamicode.com/"\">\n");            sb.Append("<param   name=\"SAMIFilename\"   value=http://www.mamicode.com/"\">\n");            sb.Append("<param   name=\"captioningID\"   value=http://www.mamicode.com/"\">\n");            sb.Append("</object><br>\n");            return sb.ToString();        }        private static string wma(string url, int width, int height)        {            System.Text.StringBuilder sb = new System.Text.StringBuilder();            sb.Append("<object   id=\"WMPlay\"   classid=\"clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95\"   style=\"Z-INDEX:   101;   LEFT:   40px;   WIDTH:   240px;   POSITION:   absolute;   TOP:   32px;   HEIGHT:   248px\"   >");            sb.Append("<param   name=\"Filename\"   value=http://www.mamicode.com/"" + url + "\">");            sb.Append("<param   name=\"PlayCount\"   value=http://www.mamicode.com/"1\">");            sb.Append("<param   name=\"AutoStart\"   value=http://www.mamicode.com/"0\">");            sb.Append("<param   name=\"ClickToPlay\"   value=http://www.mamicode.com/"1\">");            //sb.Append("<param   name=\"DisplaySize\"   value=http://www.mamicode.com/"0\">");                sb.Append("<param   name=\"EnableFullScreen   Controls\"   value=http://www.mamicode.com/"1\">");            sb.Append("<param   name=\"ShowAudio   Controls\"   value=http://www.mamicode.com/"1\">");            sb.Append("<param   name=\"EnableContext   Menu\"   value=http://www.mamicode.com/"1\">");            sb.Append("<param   name=\"ShowDisplay\"   value=http://www.mamicode.com/"1\">");            sb.Append("</object>");            return sb.ToString();        }        ///   <summary>            ///   avi格式文件播放            ///   </summary>            ///   <param   name="url"></param>            ///   <returns></returns>            private static string avi(string url, int width, int height)        {            System.Text.StringBuilder sb = new System.Text.StringBuilder();            sb.Append("<object   id=\"WMPlay\"   width=\"400\"   height=\"200\"   border=\"0\"   classid=\"clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA\">");            sb.Append("<param   name=\"ShowDisplay\"   value=http://www.mamicode.com/"0\">");            sb.Append("<param   name=\"ShowControls\"   value=http://www.mamicode.com/"1\">");            sb.Append("<param   name=\"AutoStart\"   value=http://www.mamicode.com/"1\">");            sb.Append("<param   name=\"AutoRewind\"   value=http://www.mamicode.com/"0\">");            sb.Append("<param   name=\"PlayCount\"   value=http://www.mamicode.com/"0\">");            sb.Append("<param   name=\"Appearance   value=http://www.mamicode.com/"0   value=http://www.mamicode.com/"\"\">");            sb.Append("<param   name=\"BorderStyle   value=http://www.mamicode.com/"0   value=http://www.mamicode.com/"\"\">");            sb.Append("<param   name=\"MovieWindowHeight\"   value=http://www.mamicode.com/"240\">");            sb.Append("<param   name=\"MovieWindowWidth\"   value=http://www.mamicode.com/"320\">");            sb.Append("<param   name=\"FileName\"   value=http://www.mamicode.com/"" + url + "\">");            sb.Append("</object>");            return sb.ToString();        }        private static string mpg(string url, int width, int height)        {            System.Text.StringBuilder sb = new System.Text.StringBuilder();            sb.Append("<object   classid=\"clsid:05589FA1-C356-11CE-BF01-00AA0055595A\"   id=\"WMPlay\"   width=\"239\"   height=\"250\">");            sb.Append("<param   name=\"Filename\"   value=http://www.mamicode.com/"" + url + "\"   valuetype=\"ref\">");            sb.Append("<param   name=\"Appearance\"   value=http://www.mamicode.com/"0\">");            sb.Append("<param   name=\"AutoStart\"   value=http://www.mamicode.com/"-1\">");            sb.Append("<param   name=\"AllowChangeDisplayMode\"   value=http://www.mamicode.com/"-1\">");            sb.Append("<param   name=\"AllowHideDisplay\"   value=http://www.mamicode.com/"0\">");            sb.Append("<param   name=\"AllowHideControls\"   value=http://www.mamicode.com/"-1\">");            sb.Append("<param   name=\"AutoRewind\"   value=http://www.mamicode.com/"-1\">");            sb.Append("<param   name=\"Balance\"   value=http://www.mamicode.com/"0\">");            sb.Append("<param   name=\"CurrentPosition\"   value=http://www.mamicode.com/"0\">");            sb.Append("<param   name=\"DisplayBackColor\"   value=http://www.mamicode.com/"0\">");            sb.Append("<param   name=\"DisplayForeColor\"   value=http://www.mamicode.com/"16777215\">");            sb.Append("<param   name=\"DisplayMode\"   value=http://www.mamicode.com/"0\">");            sb.Append("<param   name=\"Enabled\"   value=http://www.mamicode.com/"-1\">");            sb.Append("<param   name=\"EnableContextMenu\"   value=http://www.mamicode.com/"-1\">");            sb.Append("<param   name=\"EnablePositionControls\"   value=http://www.mamicode.com/"-1\">");            sb.Append("<param   name=\"EnableSelectionControls\"   value=http://www.mamicode.com/"0\">");            sb.Append("<param   name=\"EnableTracker\"   value=http://www.mamicode.com/"-1\">");            sb.Append("<param   name=\"FullScreenMode\"   value=http://www.mamicode.com/"0\">");            sb.Append("<param   name=\"MovieWindowSize\"   value=http://www.mamicode.com/"0\">");            sb.Append("<param   name=\"PlayCount\"   value=http://www.mamicode.com/"1\">");            sb.Append("<param   name=\"Rate\"   value=http://www.mamicode.com/"1\">");            sb.Append("<param   name=\"SelectionStart\"   value=http://www.mamicode.com/"-1\">");            sb.Append("<param   name=\"SelectionEnd\"   value=http://www.mamicode.com/"-1\">");            sb.Append("<param   name=\"ShowControls\"   value=http://www.mamicode.com/"-1\">");            sb.Append("<param   name=\"ShowDisplay\"   value=http://www.mamicode.com/"-1\">");            sb.Append("<param   name=\"ShowPositionControls\"   value=http://www.mamicode.com/"0\">");            sb.Append("<param   name=\"ShowTracker\"   value=http://www.mamicode.com/"-1\">");            sb.Append("<param   name=\"Volume\"   value=http://www.mamicode.com/"-480\">");            sb.Append("</object>");            return sb.ToString();        }        private static string rm(string url, int width, int height)        {            System.Text.StringBuilder sb = new System.Text.StringBuilder();            sb.Append("<object   ID=\"WMPlay\"   codebase=\"downloads/RealPlayer10-5GOLD_cn0302.exe\"   CLASSID=\"clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA\"   HEIGHT=" + height + "   WIDTH=" + width + ">");            sb.Append("<param   name=\"SRC\"   value=http://www.mamicode.com/"" + url + "\">");            //sb.Append("<param   name=\"_ExtentX\"   value=http://www.mamicode.com/"9313\">");                //sb.Append("<param   name=\"_ExtentY\"   value=http://www.mamicode.com/"7620\">");                sb.Append("<param   name=\"AUTOSTART\"   value=http://www.mamicode.com/"0\">");            sb.Append("<param   name=\"SHUFFLE\"   value=http://www.mamicode.com/"0\">");            sb.Append("<param   name=\"PREFETCH\"   value=http://www.mamicode.com/"0\">");            sb.Append("<param   name=\"NOLABELS\"   value=http://www.mamicode.com/"0\">");            sb.Append("<param   name=\"CONTROLS\"   value=http://www.mamicode.com/"ImageWindow,ControlPanel,statusbar\">");            sb.Append("<param   name=\"CONSOLE\"   value=http://www.mamicode.com/"Clip1\">");            sb.Append("<param   name=\"LOOP\"   value=http://www.mamicode.com/"0\">");            sb.Append("<param   name=\"NUMLOOP\"   value=http://www.mamicode.com/"0\">");            sb.Append("<param   name=\"CENTER\"   value=http://www.mamicode.com/"0\">");            sb.Append("<param   name=\"MAINTAINASPECT\"   value=http://www.mamicode.com/"0\">");            sb.Append("<param   name=\"BACKGROUNDCOLOR\"   value=http://www.mamicode.com/"#000000\">");            //sb.Append("<embed   SRC   type=\"audio/x-pn-realaudio-plugin\"   CONSOLE=\"Clip1\"   CONTROLS=\"ImageWindow\"   HEIGHT=\"250\"   WIDTH=\"354\"   AUTOSTART=\"false\">");               sb.Append("</object>");            return sb.ToString();        }        private static string swf(string url, int width, int height)        {            System.Text.StringBuilder sb = new System.Text.StringBuilder();            sb.Append("<object   codeBase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,22,87\"   ");            sb.Append("   height=\"" + height + "\"   width=\"" + width + "\"   >");            sb.Append("<param   name=\"FlashVars\"   value=http://www.mamicode.com/"\">");            sb.Append("<param   name=\"Movie\"   value=http://www.mamicode.com/"" + url + "\">");            sb.Append("<param   name=\"Src\"   value=http://www.mamicode.com/"" + url + "\">");            sb.Append("<param   name=\"WMode\"   value=http://www.mamicode.com/"Window\">");            sb.Append("<param   name=\"Play\"   value=http://www.mamicode.com/"-1\">");            sb.Append("<param   name=\"Loop\"   value=http://www.mamicode.com/"-1\">");            sb.Append("<param   name=\"Quality\"   value=http://www.mamicode.com/"High\">");            sb.Append("<param   name=\"SAlign\"   value=http://www.mamicode.com/"\">");            sb.Append("<param   name=\"Menu\"   value=http://www.mamicode.com/"0\">");            sb.Append("<param   name=\"Base\"   value=http://www.mamicode.com/"\">");            sb.Append("<param   name=\"AllowScriptAccess\"   value=http://www.mamicode.com/"always\">");            sb.Append("<param   name=\"Scale\"   value=http://www.mamicode.com/"ShowAll\">");            sb.Append("<param   name=\"DeviceFont\"   value=http://www.mamicode.com/"0\">");            sb.Append("<param   name=\"EmbedMovie\"   value=http://www.mamicode.com/"0\">");            sb.Append("<param   name=\"BGColor\"   value=http://www.mamicode.com/"\">");            sb.Append("<param   name=\"SWRemote\"   value=http://www.mamicode.com/"\">");            sb.Append("<param   name=\"MovieData\"   value=http://www.mamicode.com/"\">");            sb.Append("<param   name=\"SeamlessTabbing\"   value=http://www.mamicode.com/"1\">");            sb.Append("<embed   src=http://www.mamicode.com/"" + url + "\"   height=\"" + height + "\"   width=\"" + width + "\"   quality=\"high\"   pluginspage=\"http://www.macromedia.com/go/getflashplayer\"type=\"application/x-shockwave-flash\"   menu=\"false\">"); sb.Append("</embed>");            sb.Append("</object>");            return sb.ToString();        }        private static string mp3(string url, int width, int height)        {            System.Text.StringBuilder sb = new System.Text.StringBuilder();            sb.Append("<object   classid=\"WMPlay\"   codebase=\"http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715\"   type=\"application/x-oleobject\"   width=\"   +   width   +   \"   height=\"   +   height   +   \"   hspace=\"0\"   standby=\"Loading   Microsoft   Windows   Media   Player   components...\"   id=\"NSPlay\">");            sb.Append("<param   name=\"AutoRewind\"   value=http://www.mamicode.com/"0\">");            sb.Append("<param   name=\"FileName\"   value=http://www.mamicode.com/"   +   url   +   \">");            sb.Append("<param   name=\"ShowControls\"   value=http://www.mamicode.com/"1\">");            sb.Append("<param   name=\"ShowPositionControls\"   value=http://www.mamicode.com/"0\">");            sb.Append("<param   name=\"ShowAudioControls\"   value=http://www.mamicode.com/"1\">");            sb.Append("<param   name=\"ShowTracker\"   value=http://www.mamicode.com/"0\">");            sb.Append("<param   name=\"ShowDisplay\"   value=http://www.mamicode.com/"0\">");            sb.Append("<param   name=\"ShowStatusBar\"   value=http://www.mamicode.com/"1\">");            sb.Append("<param   name=\"ShowGotoBar\"   value=http://www.mamicode.com/"0\">");            sb.Append("<param   name=\"ShowCaptioning\"   value=http://www.mamicode.com/"0\">");            sb.Append("<param   name=\"AutoStart\"   value=http://www.mamicode.com/"1\">");            sb.Append("<param   name=\"Volume\"   value=http://www.mamicode.com/"-2500\">");            sb.Append("<param   name=\"AnimationAtStart\"   value=http://www.mamicode.com/"0\">");            sb.Append("<param   name=\"TransparentAtStart\"   value=http://www.mamicode.com/"0\">");            sb.Append("<param   name=\"AllowChangeDisplaySize\"   value=http://www.mamicode.com/"0\">");            sb.Append("<param   name=\"AllowScan\"   value=http://www.mamicode.com/"0\">");            sb.Append("<param   name=\"EnableContextMenu\"   value=http://www.mamicode.com/"0\">");            sb.Append("<param   name=\"ClickToPlay\"   value=http://www.mamicode.com/"0\">");            sb.Append("</object>");            return sb.ToString();        }        private static string img(string url, int width, int height)        {            System.Text.StringBuilder sb = new System.Text.StringBuilder();            sb.Append("<img   src=http://www.mamicode.com/"" + url + "\"   height=\"" + height + "\"   width=\"" + width + "\"   border=\"0\">");            return sb.ToString();        }    }}二。前台拼字符串JS调用写法FLV需要播放器,其它视频格式直接插入相应的代码即可。 ------------------------------------- /**    *参数说明  u - 媒体URL  w - 媒体宽度width  h - 媒体高度height  */  //播放Mediaplayer格式的视频,包括.avi .mpg .mpeg .wmv .wma .asf .mid .mp3等  function pv_m(u, w, h){  var pv=‘‘;  pv += <object width="+w+" height="+h+" id="iask_v" classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715" standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject">;  pv += <param name="FileName" value="http://www.mamicode.com/+u+">;  pv += <param name="AutoStart" value="http://www.mamicode.com/1">;  pv += <param name="AutoSize" value="http://www.mamicode.com/1">;  pv += <param name="ShowControls" value="http://www.mamicode.com/1">;  pv += <param name="ShowPositionControls" value="http://www.mamicode.com/0">;  pv += <param name="ShowAudioControls" value="http://www.mamicode.com/1">;  pv += <param name="ShowTracker" value="http://www.mamicode.com/1">;  pv += <param name="ShowDisplay" value="http://www.mamicode.com/0">;  pv += <param name="ShowStatusBar" value="http://www.mamicode.com/1">;  pv += <param name="ShowGotoBar" value="http://www.mamicode.com/0">;  pv += <param name="ShowCaptioning" value="http://www.mamicode.com/0">;  pv += <param name="PlayCount" value="http://www.mamicode.com/1">;  pv += <param name="AnimationAtStart" value="http://www.mamicode.com/0">;  pv += <param name="TransparentAtStart" value="http://www.mamicode.com/0">;  pv += <param name="AllowScan" value="http://www.mamicode.com/0">;  pv += <param name="EnableContextMenu" value="http://www.mamicode.com/0">;  pv += <param name="ClickToPlay" value="http://www.mamicode.com/0">;  pv += <param name="InvokeURLs" value="http://www.mamicode.com/1">;  pv += <param name="DefaultFrame" value="">;  pv += <embed src="http://www.mamicode.com/+u+" width="+w+" height="+h+" type="application/x-mplayer2" pluginspage="http://www.microsoft.com/isapi/redir.dll?prd=windows&;sbp=mediaplayer&ar=media&sba=plugin&" name="MediaPlayer" showcontrols="1" showpositioncontrols="0" showaudiocontrols="1" showtracker="1" showdisplay="0" showstatusbar="1" autosize="0" showgotobar="0" showcaptioning="0" autostart="1" autorewind="0" animationatstart="0" transparentatstart="0" allowscan="1" enablecontextmenu="1" clicktoplay="0" invokeurls="1" defaultframe=""></embed>;  pv += </object>;  document.write(pv);  }  //播放Realplay格式的视频,包括.rm .ram .rmvb等  function pv_r(u, w, h){  var pv=‘‘;  pv += <object width="+w+" height="+h+" id="iask_v" classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA">;  pv += <param name="SRC" value="http://www.mamicode.com/+u+">;  pv += <param name="AUTOSTART" value="http://www.mamicode.com/1">;  pv += <param name="CONTROLS" value="http://www.mamicode.com/Imagewindow,StatusBar,ControlPanel">;  pv += <param name="_ExtentX" value="http://www.mamicode.com/18415">;  pv += <param name="_ExtentY" value="http://www.mamicode.com/9102">;  pv += <param name="SHUFFLE" value="http://www.mamicode.com/0">;  pv += <param name="PREFETCH" value="http://www.mamicode.com/0">;  pv += <param name="NOLABELS" value="http://www.mamicode.com/0">;  pv += <param name="CONSOLE" value="http://www.mamicode.com/Clip1">;  pv += <param name="LOOP" value="http://www.mamicode.com/0">;  pv += <param name="NUMLOOP" value="http://www.mamicode.com/0">;  pv += <param name="CENTER" value="http://www.mamicode.com/0">;  pv += <param name="MAINTAINASPECT" value="http://www.mamicode.com/0">;  pv += <param name="BACKGROUNDCOLOR" value="http://www.mamicode.com/#000000">;  pv += <embed src="http://www.mamicode.com/+u+" width="+w+" height="+h+" type="audio/x-pn-realaudio-plugin" console="Clip1" controls="Imagewindow,StatusBar,ControlPanel" autostart="true">;  pv += </object>;  document.write(pv);  }  //播放Quicktime格式的视频,包括.mov .amr .3gp等  function pv_q(u, w, h){  var pv=‘‘;  pv += <object width="+w+" height="+h+" classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab">;  pv += <param name="src" value="http://www.mamicode.com/+u+">;  pv += <param name="controller" value="http://www.mamicode.com/true">;  pv += <param name="type" value="http://www.mamicode.com/video/quicktime">;  pv += <param name="autoplay" value="http://www.mamicode.com/true">;  pv += <param name="target" value="http://www.mamicode.com/myself">;  pv += <param name="bgcolor" value="http://www.mamicode.com/black">;  pv += <param name="pluginspage" value="http://www.apple.com/quicktime/download/index.html">;  pv += <embed src="http://www.mamicode.com/+u+" width="+w+" height="+h+" controller="true" align="middle" bgcolor="black" target="myself" type="video/quicktime" pluginspage="http://www.apple.com/quicktime/download/index.html"></embed>;  pv += </object>;  document.write(pv);  }