Wowza Community

Streaming to HTML5 audio tag

Hi. I want to stream an mp3 to html5 audio tag. How to i do this? Is it the same procedure as with the video tag?

Use the video tag and mp3: prefix

<video controls src="http://[wowza-address]:1935/vod/mp3:song.mp3/playlist.m3u8">

Richard

You can re-stream Shoutcast in Wowza, and that can be played back in iOS. Use the video (not audio) tag and a .stream file in, and start the shoutcast stream in StreamManager with MediaCaster type “shoutcast”. The Application.xml /StreamType should be “live” instead of “shoutcast” in this case. Playback URL for iOS is something like :

http://[wowza-address]:1935/shoutcast/station1.stream/playlist.m3u8

Richard

Nui,

Use javascript video.play()

Take a look at this example for reference:

https://www.wowza.com/docs/how-to-do-pre-roll-and-playlist-for-ios-a-client-side-work-around

Richard

Use RTSP on Android all versions

You can use Flash RTMP and Flash HTTP on Android 2.2+

Make sure the audio is AAC. MP3 is not supported on Android as far as I know

Richard

Should shoutcast stream work for video and/or audio tag for HTML as well?

You can use MP3 in Flash on Android. You just can’t use MP3 with apps that were built using the Android SDK.

I want player auto play.

I used

It don’t auto play.

How should I solve the problem?

Thank

Nui

HLS isn’t supported by the client you listed. It is supported by iOS and android >= 3.0 and OSX with Safari, but not supported by IE9 or Chrome.

For the later two use flash player and the rtmp url.

It’s best to use the user agent string to detect all the different cases and act accordingly.

  • Daren

You can re-stream Shoutcast in Wowza, and that can be played back in iOS. Use the video (not audio) tag and a .stream file in, and start the shoutcast stream in StreamManager with MediaCaster type “shoutcast”. The Application.xml /StreamType should be “live” instead of “shoutcast” in this case. Playback URL for iOS is something like :

http://[wowza-address]:1935/shoutcast/station1.stream/playlist.m3u8

Richard

Hi Richard,

Do you know how you can do the same for Android, but for audio, please ?

I’ve do for iOS http://[wowza-address]/streamname.m3u and work well. But for Android ?

I’m working the same issue, playing an audio-only stream, but cannot get a successful play of an audio stream. I’m encoding with Flash Encoder to an mp3, and using this player

		<div>
                Video Player example <br />
                <video controls="controls" width="320" height="60" >
                	<source src="http://ServerIP:1935/live/mp3:myStream/playlist.m3u8" 
                    	type="audio/mpeg" />
                </video>
                </div>

I get a connect and create myStream from the Wowza server, but when I mouse over the play button in the video player, it goes grey, and will not play. Some 15 seconds later, Wowza destroys the stream and disconnects.

I am using Chrome on Windows. This has got to be something simple.

Joe