December 29, 2011

how to play wav stream in safari vai javascript

Question by Jeffrey Hsu

I’ve tried Audio / embed / Object, but fail at all of them.

play wave file is ok, but cannot play stream.

<audio><source src="sample.wav" /></audio> OK

<audio><source src="http://mydomain/stream" /></audio> fail

<object data="sample.wav"></object> OK

<object data="http://mydomain/stream"></object> fail

jPlayer also cannot work!

I found a clue:
If when I play it in firefox before, then safari works. It seems firefox download it so the safari can play it in quicktime’s cache.
<embed src="" height="45" width="170" type="audio/x-wav"/>

Answer by Starx

You should use html5audioplayer. It slags a bit, but works in the end….


Please fill the form - I will response as fast as I can!