web 客户端浏览器播放服务端的视频文件
web 客户端浏览器播放服务端的视频文件
web 服务器和客户机在2台机器上,在服务器上播放工程中的视频资源是ok的
关键是 在客户端机器上,通过浏览器访问服务器端的视频资源却加载不了,代码如下所示,求大侠指点
<div>
<asp:Label id="lbl_MediaPlayer" style="Z-INDEX: 101; LEFT: 8px; POSITION: absolute; TOP: 8px"
runat="server" Width="104px"></asp:Label>
</div>
后台代码
protected void Page_Load(object sender, EventArgs e)
{
Response.Write("Hello");
string savepath = Server.MapPath("~/Video/特殊身份_hd.mp4");
string filename = @"D:\Share\特殊身份_hd.mp4";
if (!this.IsPostBack)
{
this.lbl_MediaPlayer.Text = this.PlayMedia(filename);
}
}
public string PlayMedia(string MediaFile)
{
string strScript =
"<TABLE id=\"Table2\" align=\"center\" border=\"0\" runat=\"server\" width = '620' height ='450'>"
+ "<TR>"
+ "<TD align=\"center\">"
+ "<OBJECT id=\"mdpTrailer\" classid=\"clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95\" name=\"mdpTrailer\" width='620' height = '450'>"
+ "<PARAM NAME=\"AudioStream\" VALUE=\"-1\">"
+ "<PARAM NAME=\"AutoSize\" VALUE=\"-1\">"
+ "<PARAM NAME=\"AutoStart\" VALUE=\"-1\">"
+ "<PARAM NAME=\"AnimationAtStart\" VALUE=\"-1\">"
+ "<PARAM NAME=\"AllowScan\" VALUE=\"-1\">"
+ "<PARAM NAME=\"AllowChangeDisplaySize\" VALUE=\"-1\">"
+ "<PARAM NAME=\"AutoRewind\" VALUE=\"0\">"
+ "<PARAM NAME=\"Balance\" VALUE=\"0\">"
+ "<PARAM NAME=\"BaseURL\" VALUE=\"\">"
+ "<PARAM NAME=\"BufferingTime\" VALUE=\"5\">"
+ "<PARAM NAME=\"CaptioningID\" VALUE=\"\">"
+ "<PARAM NAME=\"ClickToPlay\" VALUE=\"-1\">"
+ "<PARAM NAME=\"CursorType\" VALUE=\"0\">"
+ "<PARAM NAME=\"CurrentPosition\" VALUE=\"-1\">"