-
1. Re: Seam 2 framework to display video in web page
jr_rodriguez_l May 14, 2012 12:27 PM (in response to vanimahesh)Videos stored in database are not recommended by performance reasons, I reccomend you to remove your blob field from your database and dump it to a folder in your website and add a string path to it in the database, that's a very good practice
I can give you other two solutions that you can research:
Solution A: Render the video with a4j:mediaOutput from Richfaces
<a:mediaOutput element="#{yourBean.yourByteArrayField}" mimeType="video/avi"
createContent="#{sampleBean.paint}" value="#{item}"
style="width:25px; height:25px;" cacheable="false">
</a:mediaOutput>
this is the method in SampleBean:
public void paint(OutputStream stream, Object object) throws IOException
{
Tbookactividad a = (Tbookactividad)object;
if (a!=null) {
if (a.getBimagen()!=null && a.getBimagen().length>0) {
stream.write(a.getBimagen());
}
}
}
Solution B: Render the video with p:media from Primefaces 1.1 for JSF 1.2
You can use primefaces 1.2 to show your media contents, only you have to specify your content mime type:
<p:media value="http://www.youtube.com/v/KZnUr8lcqjo" width="425" height="344" player="quicktime"/>
-
2. Re: Seam 2 framework to display video in web page
maheshabr May 20, 2012 4:06 PM (in response to jr_rodriguez_l)Thanks Juan