0

I can't get p:media to work, tested with Chrome and IE, different Quicktime- and Windows-types over StreamedContent (see example below) and by referencing it from the resources-folder (value=/resources/clear.avi) of my webapp. No video starts to play although loading & rendering seems to be "working" per se. The player shows up and the loaded video seems not to be broken while the files aren't for sure (playing works on desktop usage). When using StreamedContent, I start to render after loading the video.

My config:

  • PrimeFaces 3.5
  • Apache MyFaces 2.1.12
  • Jetty 9.0.4

What can be wrong here?

<h:panelGroup id="video">
     <p:media value="#{contentEditorBean.media}" width="250" height="190" player="windows" rendered="#{contentEditorBean.media != null}">
                <f:param name="autoPlay" value="false" />
     </p:media>
</h:panelGroup>
JavaKaffee
  • 67
  • 2
  • 8
  • You're not clear on if this is a problem in uploaded file itself (i.e. you can't even play them directly on disk file system, independently from JSF), or that it forms a problem only in ``. The first paragraph of your question suggests that the first is the case, but then you seem to unexpectedly go into the JSF aspect while still having the playing problem. – BalusC Aug 16 '13 at 11:38
  • Updated the question. The file works, but not by using it in p:media while p:graphicImage works with uploaded images. – JavaKaffee Aug 16 '13 at 12:51
  • Why are you then showing how you uploaded the file while that part apparently works fine? It's only making your question more confusing. Just discuss and show the broken code. "I have a movie file in location X which works individually fine, I am playing it using as follows (...), it fails this and that way (...). How is this caused and how can I solve it?". No irrelevant noise. – BalusC Aug 16 '13 at 13:03
  • While hoping that I don't have to paste in all that stuff again, because everyone asks for more than this almost showcase-example-like snippet, now it says what I did until now... I hope at least. – JavaKaffee Aug 16 '13 at 16:19
  • Okay, that's clearer. Well, is the value behind `#{contentEditorBean.media}` guaranteed idempotent? I.e. when you refresh the page, very the same video file should be requested. If necessary, this can only be achieved by parameterizing `` with a `` representing the unique video identifier. Related and possibly duplicate: http://stackoverflow.com/questions/14232339/how-to-bind-dynamic-pdf-content-using-pmedia/14233829#14233829 – BalusC Aug 16 '13 at 16:23
  • At the beginning I started with [this](http://blog.primefaces.org/?p=814) and [your way](http://stackoverflow.com/a/13704521/1343241) for getting things uploaded. After page refresh the video was gone and I found out that `StreamedContent` isn't held in memory. So I saved the `byte[]` and `media` gets a `new DefaultStreamedContent` every time now. I will check the linked article, but why does the **hardcoded reference** not work then either? – JavaKaffee Aug 16 '13 at 16:52

0 Answers0