SOURCE Download: http://download.csdn.net/detail/njxiaogui/7609687
Front desk:. aspx
<table> <tr> <td><div id= "video_content" runat= "Server" style= "></div> </td> </tr> </table>
Backstage. CS (Get the address of FLV through the background for video playback)
protected void Page_Load (object sender, EventArgs e) {this.video_content. InnerHtml = Play ("sp.flv", 472, 385); public static string Play (string url, int width, int height) {string strtmp = URL. ToLower (); if (Strtmp.endswith (". flv")) {return flv (URL, width, height); } else {return "video file data error"; }} private static string flv (string url, int width, int height) {System.Text.StringBuild ER 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=\" vcastr_file= "+URL + "&logotext=www.um173.com&buffertime=3\" > "); Sb. Append ("<param name=\" movie\ "value=\" flvplayer.swf\ ">"); Sb. Append ("<param name=\" allowfullscreen\ "value=\" true\ ">"); Sb. Append ("<param name=\" wmode\ "value=\" window\ ">"); Sb. Append ("<param name=\" play\ "value=\" 1\ ">"); Sb. Append ("<param name=\" loop\ "value=\" -1\ ">"); Sb. Append ("<param name=\" quality\ "value=\" high\ ">"); Sb. Append ("<param name=\" salign\ "value=\" \ ">"); Sb. Append ("<param name=\" menu\ "value=\" 0\ ">"); Sb. Append ("<param name=\" base\ "value=\" \ ">"); Sb. Append ("<param name=\" allowscriptaccess\ "value=\" always\ ">"); Sb. Append ("<param name=\" scale\ "value=\" showall\ ">"); Sb. Append ("<param name=\" devicefont\ "value=\" 0\ ">"); Sb. Append ("<param name=\"Embedmovie\" value=\ "0\" > "); Sb. Append ("<param name=\" bgcolor\ "value=\" \ ">"); Sb. Append ("<param name=\" swremote\ "value=\" \ ">"); Sb. Append ("<param name=\" moviedata\ "value=\" \ ">"); Sb. Append ("<param name=\" seamlesstabbing\ "value=\" 1\ ">"); Sb. Append ("<param name=\" profile\ "value=\" 0\ ">"); Sb. Append ("<param name=\" profileaddress\ "value=\" \ ">"); Sb. Append ("<param name=\" profileport\ "value=\" 0\ ">"); Sb. Append ("<embed src=\" flvplayer_progressive.swf\ "flashvars=\" vcastr_file= "+ URL +" &logotext=www.um173.com\ " Height=\ "+ height +" \ "width=\" "+ width +" \ "quality=\" high\ "pluginspage=\" Http://www.macromedia.com/go/getfla Shplayer\ "type=\" application/x-shockwave-flash\ "menu=\" false\ ">"); Sb. Append ("</embed>"); Sb. Append ("</object>"); Return SB. ToString (); }
The FLV video playback plug-in that needs to be supported is: flvplayer.swf,flvplayer_progressive.swf
ASP. NET background gets the FLV video address to play "go"