插入視頻和falsh

來源:互聯網
上載者:User

插入視頻方法,播放flv的,頁面放一個label,取名叫lVideo,

string text="顯示的title";

string file="帶尾碼的檔案名稱flv";

StringBuilder veido = new StringBuilder();
        veido.Append("<script type='text/javascript'>");
        veido.Append("var swf_width=220;");
        veido.Append("var swf_height=165;");
        veido.Append("var texts='"+text+"';");

//檔案的路徑
        veido.Append("var files='/Upload/Video/"+file+"';");
        veido.Append("document.write('<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=/"'+ swf_width +'/" height=/"'+ swf_height +'/">');");
        veido.Append("document.write('<param name=/"IsAutoPlay/" value=/"0/">');");
        veido.Append("document.write('<param name=/"movie/" value=/"/vcastr2.swf/"><param name=/"quality/" value=/"high/">');");
        veido.Append("document.write('<param name=/"menu/" value=/"false/"><param name=wmode value=/"opaque/">');");
        veido.Append("document.write('<param name=/"FlashVars/" value=/"vcastr_file='+files+'&vcastr_title='+texts+'/">');");

//下載vscatr2.swf,不然播放不了,vscatr2支援自訂是否自動播放"IsAutoPlay=0”
        veido.Append("document.write('<embed src=/"/vcastr2.swf/" wmode=/"opaque/" FlashVars=/"vcastr_file='+files+'&vcastr_title='+texts+'& menu=/"false/" quality=/"high/" width=/"'+ swf_width +'/" height=/"'+ swf_height +'/" type=/"application/x-shockwave-flash/" pluginspage=/"http://www.macromedia.com/go/getflashplayer/" />');");
        veido.Append("document.write('</object>');");
        veido.Append("</script>");
        lVideo.Text = veido.ToString();

 

插入flash代碼,符合w3c標準,有很多其他方法插入

<object width="313" height="55" name="myswf" type="application/x-shockwave-flash"
                    data="logo.swf">
                    <param name="movie" value="logo.swf" />
                </object>

logo.swf為flash檔案名稱

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.