You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Yousri BENDI ABDALLAH <b....@gmail.com> on 2008/05/15 18:16:55 UTC

[Struts 2] Video Action

Hello ,

I have a problem with the integration of a video (wmv format) within a JSP
page. To that end I use the tag html <object> which allows me to integrate
my video played with Windows Media Player, these videos are stored on an
application server Weblogic 8.1. But I faced the following problem: my tag
object should recover within its attribute "src" a stream obtained from an
action struts 2. If a recovery this flow is done smoothly in the event of a
gif or jpeg image, the same action can not play the video in the drive
(displaying a black screen on the player without the possibility of
reading).


Viewing an image (runs smoothly):

<img src="/DLImage.action?file=chateau.gif" />

Viewing a video:

<object type="video/x-ms-wmv" width="320" height="255">
     <param name="src" value="/Download.action?file=test.wmv" />
     <param name="autoStart" value="0" />
</ object>

The actions DLImage.action and Download.action make available a flow-type
java.io.FileInputStream from the files stored on the server.

Please give me your comments if you've already encountered a similar problem
or if you have a solution or alternative to propose, I would be grateful!


-- 
Yousri BENDIABDALLAH

Re: [Struts 2] Video Action

Posted by Jeromy Evans <je...@blueskyminds.com.au>.
Yousri BENDI ABDALLAH wrote:
> Hello ,
>
> I have a problem with the integration of a video (wmv format) within a JSP
> page. To that end I use the tag html <object> which allows me to integrate
> my video played with Windows Media Player, these videos are stored on an
> application server Weblogic 8.1. But I faced the following problem: my tag
> object should recover within its attribute "src" a stream obtained from an
> action struts 2. If a recovery this flow is done smoothly in the event of a
> gif or jpeg image, the same action can not play the video in the drive
> (displaying a black screen on the player without the possibility of
> reading).
>
>
> Viewing an image (runs smoothly):
>
> <img src="/DLImage.action?file=chateau.gif" />
>
> Viewing a video:
>
> <object type="video/x-ms-wmv" width="320" height="255">
>      <param name="src" value="/Download.action?file=test.wmv" />
>      <param name="autoStart" value="0" />
> </ object>
>
> The actions DLImage.action and Download.action make available a flow-type
> java.io.FileInputStream from the files stored on the server.
>
> Please give me your comments if you've already encountered a similar problem
> or if you have a solution or alternative to propose, I would be grateful!
>
>
>   

I suggest you use FireBug or the HttpHeaders plugin for FireFox to 
examine the header for the response from your action compared to a wmv 
served directly by the container.  It's likely that the 
Content-Disposition header, Content-Size or Content-Length is 
incorrect.  You'll probably need to change the parameters passed to the 
StreamResult.



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org