Search code examples
primefacesmobile-websiteprimefaces-mobile

Cannot play using p:media tag in primefaces-mobile web app


I am developing a primefaces-mobile web app. I want to use p:media tag, but it does not show video on mobile device. My code:

<p:media value="#{basePath}/resources/3.mp4" width="340"
    height="250" player="quicktime">
    <f:param name="autoPlay" value="false" />
</p:media>

But on the same page, following code works perfectly fine:

<video width="400" height="300" controls="controls">
    <source src="#{basePath}/resources/3.mp4" type="video/mp4" />
</video>

Solution

  • If I'm not mistaken, p:media generates a quicktime specific tag. The <video> tag is html5 and thus differs. For the first one you need a quicktime player and for the second you need a html5 capable browser.

    You don't need to use a PrimeFaces tag ;-) html tags are fine too. Afaik html5 is supported on Android by default, I'm not sure about IPhone/IPad though.