开发者

Help required in rendering HTML <object> in Flex which embeds a video of any format

Here is where I am at this juncture...

I have a requirement wherein I need to render an HTML text containing an '' tag which embeds a video, for example:-

<object width="320" height="240"
       data="javascript/media/ABC.wmv"
       type="application/x-mplayer2">
      <param name="url" value="javascript/media/ABC.wmv" />
</object>

Now I ne开发者_如何学Ced to render this video into my Flex Web Application.

One way to do it, as I see, is somehow extract the 'data' attribute and put it as a 'source' for spark VideoPlayer.

Is there any better way to do this?

Also note that, I require to render all video formats (avi, mov, wmv etc.) and not just flv or f4v. Any pointers for this would be appreciated.

Thanks


Extracting the data/value attribute and embedding it into a VideoPlayer component is a fine way to go. However, you aren't going to be able to play all video formats; only flv, f4v and mp4 containers. If you want to play formats such as wmv you will need to convert the video first on the server, either using an open-source tool such as ffmpeg or by using a commercial video encoding web-service.

Alternatively you could go the route of using the browser to play the video and trying to hover an iframe over your Flex application (although this will probably be pretty fiddly and non cross-browser compatible). However, even doing this there is no guarantee that the browser will be able to play the format so conversion is probably your best bet.

Dave

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜