streaming an object to the browser

G

Guest

hi,

i am doing a proof of concept and trying to stream 2 objects to the browser
one is a pdf and another is a .3g2 video file. when i try to do the pdf it
works great and the pdf opens in the browser but when i do the video file it
just returns the gibrish from the byte[]. the vodeo is fine because when i
link to the video directly then quicktime opens in the browser and it starts
to play.

I checked anyway and the 3g2 extension is on the machine and associated with
quicktime.

i just cant understand why the browser dosent start the video then i stream
it. any ideas????

check out the code.

FileStream fs = new FileStream(@"c:\website1\test.3g2", FileMode.Open);
//FileStream fs = new FileStream(@"c:\website1\test.pdf", FileMode.Open);
byte[] b = new byte[fs.Length];
fs.Read(b, 0, (int)fs.Length);
fs.Close();
fs.Dispose();
Response.ContentType = "video/3g2";
//Response.ContentType = "text/pdf";
Response.BinaryWrite(b);
 
S

slagomite

did you try any of these content types?

video/3gpp
video/3gpp-tt
video/3gpp2

or maybe

video/quicktime

HTH
Luke
 
G

Guest

I have tried all except video/quicktime. Just tried that and it also returns
gibrish. Any other ideas?
 
G

Guest

in addition i tried to do this with a .mov(video/quicktime) file and a
..wmv(video/x-ms-wmv) file. i get the same gibrish.

agian it works when you link to the file for video but the streaming works
for a pdf.

if it works for the pdf, why not the video, its the same concept.

does this mean you can stream certian objects in .net???
 
G

Guest

GOT IT!

had to add
Response.Flush();

after
Response.BinaryWrite(b);

just incase anyone encounters this.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top