2 Replies Latest reply on Apr 17, 2009 1:45 PM by Flavio Henrique

    how can i play mp3, mp4, flash with richfaces

    wu kevin Newbie

      I use a4j:mediaOutput like the following, but it did not work well.

      jsp:
      <a4j:mediaOutput element="object" session="true" createContent="#{login.paint}" value="/jsp/1.mp4" cacheable="false" width="300"/>

      login bean:

      public synchronized void paint(OutputStream stream, Object object) throws IOException {
      ServletContext cont = (ServletContext)FacesContext.getCurrentInstance().getExternalContext().getContext();
      InputStream is = cont.getResourceAsStream((String)object);

      org.apache.commons.io.IOUtils.copy(is, stream);

      stream.flush();
      is.close();
      }

        • 1. Re: how can i play mp3, mp4, flash with richfaces
          Ilya Shaikovsky Master

           

          but it did not work well


          what the result?

          • 2. Re: how can i play mp3, mp4, flash with richfaces
            Flavio Henrique Newbie

             

            "ilya_shaikovsky" wrote:
            but it did not work well


            what the result?


            Hmm... I'm interested in this too, so I tried the code with mp3 and swf files and my results are:
            using:
            richfaces-api-3.3.1-20090413.041252-63.jar

            Firefox 3.0.8:
            Caused by: java.net.SocketException: Connection reset by peer: socket write error
            at java.net.SocketOutputStream.socketWrite0(Native Method)

            Internet Explorer 6:
            no exception but no play

            Chrome 1.0.154.48:
            No exception, but it offers a download of:
            eAFtkkFrFEEQhSuDwSiK4gbRgxBWURDpAY0kJAYVFRUmLjhGUEGozNTu9tIz3Xb37DYGvYmg4MWrB8GDF73oyb8Q8JLfIIiIFxG82t0blATnVsOr976q6nc!YNJoOCl1j-EA3ezAdJkmIxtdEFsxpG9uFsdWNL-MFiF8rbPfE9iRwd5CE1q6JGtLtbVwIBvgEFOBdS!trA6osIsZ7CSnuPd8AI9hIoOpSpa8y6ncrCeHKBqKhVOe5XiwcKyLBRlWyEr

            In fact, I didn't know that mediaOutput could play flash movies,