I need the reproduce a MP3 from an URL. So, in my page use this:
<ice:outputMedia binding="#{boardBean.opMedia}" id="opMedia"/>
<ice:commandButton image="#{icon.imagen}" action="#{boardBean.selectIcon(icon)}">
<f:ajax render="opMedia"/>
</ice:commandButton>
Then, in the backing bean "BoardBean" (is @Viewscoped)
this.opMedia.setSource(uri.toString());
The idea is when an icon is selected, the url with a sound is formed and is set as source of the outputMedia.
In Google chrome works good. In every click the ice:outputMedia
component is rerendered so the mp3 is reproduced. But in Firefox and IExplorer don't. I does not rerender the component with the new property, so the Mp3 is not played
Any ideas why? Is there a "more standard" way to do this that works in all browsers?
I found the problem. The uri.toString()
method is returning a String that has special characters as '&'. This character is replaced by &
. Chrome is able to decode this to the correct character and retrieve the URL, but IE and Firefox can't.
Now , the problem will be to find a solution to this encode/decode problem. But this will be in another thread.