Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET Video Handler
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:
 
   <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:
 
<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:
 
<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:
 
<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 19-Dec-12 2:14am
GGev394
Edited 20-Dec-12 1:09am
v6
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

This link can help you.
 
HO TO ADD FLASH OR SWF FILE IN MY ASP.NET WEB SITE[^]
 
thank
Rashed::Bangladesh
  Permalink  
Comments
GGev at 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.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

I've just removed all data for Response Header in http handler and now it works.
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 328
1 Sergey Alexandrovich Kryukov 295
2 Gihan Liyanage 292
3 ClimerChinna 232
4 Abhinav S 192
0 Sergey Alexandrovich Kryukov 8,213
1 OriginalGriff 7,089
2 CPallini 2,598
3 Richard MacCutchan 1,925
4 Abhinav S 1,778


Advertise | Privacy | Mobile
Web04 | 2.8.140826.1 | Last Updated 21 Dec 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100