Click here to Skip to main content
15,891,375 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi guys,

Read the last EDIT, please.

I have a page in which I should display some media data.
For this I'm using html <object>tag, like this:

HTML
<object type="video/x-ms-wmv" width="320" height="240">
     <param name="src" value="some_media_url" />
     <param name="AutoSize" value="true">
     <param name="ShowDisplay" value="false">
     <param name="AutoStart" value="false">
     <param name="StretchToFit" value="true">
     <param name="bgcolor" value="#ffffff" />
 </object>

In my case, I should get media data from SQL server by some MediaHandler.ashx http handler.
When I get an audio(.mp3, .wma) or video(.flv, .mp4) stream this works fine.
But I'm getting some problems with .swf flash files.
For this type of files I change <object> type to be "application/x-shockwave-flash". In this case when I use some remote path, like http://www.tizag.com/pics/example.swf, it works fine:

HTML
<object type="application/x-shockwave-flash" width="320" height="240">
        <param name="src" value='http://www.tizag.com/pics/example.swf' />
        <param name="AutoSize" value="true">
        <param name="ShowDisplay" value="false">
        <param name="AutoStart" value="false">
        <param name="StretchToFit" value="true">
    </object>

But, it doesn't work with my handler. It neither works with local paths,like "c:\videos\example.swf"

EDIT :

This works fine, if I directly refer to an existing file:

HTML
<object type="application/x-shockwave-flash" width="320" height="240">
        <param name="src" value="/videos/ETFflash1016.swf" />
        <param name="AutoSize" value="true">
        <param name="ShowDisplay" value="false">
        <param name="AutoStart" value="true">
        <param name="StretchToFit" value="true">
    </object>


But when I use httpHandler to get file from DB:

HTML
<object type="application/x-shockwave-flash" width="320" height="240">       
    <param name="src" value="http://localhost:57031/MediaHandler.ashx?Id=512429" />
    <param name="AutoSize" value="true">
    <param name="ShowDisplay" value="false">
    <param name="AutoStart" value="true">
    <param name="StretchToFit" value="true">
</object>


flash is not displayed.

I've compared the output html for these cases, they're the same in both cases (except src param value). Fiddler shows the same result for both requests for .swf file and the browser shows(e.g. in IE dev tool's Netwok tab) that the file was downloaded to client in both cases. BUT in the case with the handler, flash is not being displayed.

Any idea?
Posted
Updated 20-Dec-12 1:09am
v6

This link can help you.

HO TO ADD FLASH OR SWF FILE IN MY ASP.NET WEB SITE[^]

thank
Rashed::Bangladesh
 
Share this answer
 
Comments
GGev 20-Dec-12 3:24am    
The problem is, that I'm adding .swf file by httpHandler like this: MediaHandler.ashx?id=1111. Only in this case I can't see the flash content.
I've just removed all data for Response Header in http handler and now it works.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900