一次播放多个视频

时间:2021-01-11 12:02:24

标签: c# asp.net asp.net-mvc video-streaming

我正在使用 http 处理程序从数据库中检索视频 这是我的代码

SqlConnection con = new SqlConnection(GetAttachmentConnectionString());
string vidId = context.Request.QueryString["VidID"];
con.Open();

SqlCommand command = new SqlCommand("select FileData from Attachment where AttachmentId = 1002", con);

SqlDataReader dr = command.ExecuteReader();
dr.Read();
context.Response.Buffer = true;
context.Response.ContentType = "video/mp4";
context.Response.BinaryWrite((Byte[])dr[0]);

con.Close();
context.Response.End();

我在客户端页面上使用了 Video 标签。 问题是,如果页面上只有一个视频在播放,则一切正常。如果我检索多个,它会显示一个带有控件和时间 0:0 的黑框

我该如何解决这个问题?

1 个答案:

答案 0 :(得分:0)

为此使用中继器查看数据库中的多个视频