/ / streaming video nie działa w IE - asp.net, streaming, video.js

streaming video nie działa w IE - asp.net, streaming, video.js

Oto moje pomysły: 1. Wyssanie wideo z darmowego hostingu na mój serwer (OK) Przykład: http://yanoshop.com/dms/xem/dms.aspx?url=http://up.4share.vn/f/3103020403020003/3830e2bfe4bdc4091f28a94d1fb9bf3d.webm.file 2. Następnie przesyłanie strumieniowe pliku z serwera do klienta (OK w FireFox i Chrome, ale IE) Przykład: http://www.yanoshop.com/dms/xem/webm.aspx?u=http://yanoshop.com/dms/xem/dms.aspx?url=http://up.4share.vn/f/3103020403020003/3830e2bfe4bdc4091f28a94d1fb9bf3d.webm.file

Uwaga:Uruchamiam to na urządzeniach mobilnych za pomocą HTML5 (używam wtyczki VideoJS)

Oto kod, którego używam:

//Create a stream for the file

Stream stream = null;

//This controls how many bytes to read at a time and send to the client
int bytesToRead = 50000;

// Buffer to read bytes in chunk size specified above
byte[] buffer = new Byte[bytesToRead];

// The number of bytes read
try
{
//Create a WebRequest to get the file
HttpWebRequest fileReq = (HttpWebRequest)HttpWebRequest.Create(downloadLink);
fileReq.Timeout = 99999;
//Create a response for this request
HttpWebResponse fileResp = (HttpWebResponse)fileReq.GetResponse();

if (fileReq.ContentLength > 0)
fileResp.ContentLength = fileReq.ContentLength;

//Get the Stream returned from the response
stream = fileResp.GetResponseStream();

// prepare the response to the client. resp is the client Response
Response.Clear();
Response.AddHeader("Pragma", "public");
Response.Expires = 0;
Response.AddHeader("Cache-Control", "no-cache, must-revalidate");
Response.AddHeader("Cache-Control", "public");
Response.AddHeader("Content-Description", "File Transfer");

Response.Cache.SetCacheability(HttpCacheability.Public);
Response.Cache.SetLastModified(DateTime.Now);

//Indicate the type of data being sent
Response.ContentType = ExtentionToContentType(filename);
Response.AddHeader("Accept-Ranges", "bytes");

//Name the file
Response.AppendHeader("Content-Disposition", "filename=" + filename);
Response.AddHeader("Content-Length", fileResp.ContentLength.ToString());
//Response.AddHeader("Content-Encoding", "gzip");

//Response.AddHeader("Accept-Header", stream.Length.ToString());
int length;
int count = 0;
if (count == 0)
{

}
do
{
// Verify that the client is connected.
if (Response.IsClientConnected)
{
// Read data into the buffer.
length = stream.Read(buffer, 0, bytesToRead);

// and write it out to the response"s output stream
Response.OutputStream.Write(buffer, 0, length);

// Flush the data
Response.Flush();

//Clear the buffer
buffer = new Byte[bytesToRead];
}
else
{
// cancel the download if client has disconnected
length = -1;
}
} while (length > 0); //Repeat until no data is read
}
finally
{
if (stream != null)
{
//Close the input stream
stream.Close();
}
}

Odpowiedzi:

0 dla odpowiedzi № 1

Wygląda na to, że używasz pliku WebM, który obsługuje przeglądarki Chrome i Firefox, ale IE9 nie.