Playing an audio stream using html5

How can I play RTSP streams using the HTML5 tag, I already check the streaming links with wowza http and RTSP that work fine on VLC, but when I insert these links in the html5 tag nothing works, any help would be appreciated. Here is my HTML5 code

<!DOCTYPE html> <html> <body> <audio controls> <source src="http://[ServerIP]:1935/bw/_definst_/mp3:audio/64kbps/A_B_C_D_Any_Body_Can_Dance_Bezubaan.mp3/playlist.m3u8" type="audio/mpeg"> Audio not supported </audio> </body> </html> 

Edit: Stream works fine on smartphones but doesn't work on PC browsers

+6
source share
2 answers

HLS (m3u8 files) will play on iOS (and some Android, but support may be awkward) and Mac OS Safari in the HTML5 tag: <video width="640" height="360" preload="auto" controls src="http://[ServerIP]:1935/vod/test.mp4/playlist.m3u8"></video>

RTSP can be played on Android via a tag in Chrome:

 <div id="myElement"> <a href="rtsp://[ServerIP]:1935/vod/mp4:test.mp4">watch this stream over RTSP</a> </div> 

RTSP should work in the HTML5 tag on Android, but only in the native browser (well, this is my experience with it, I usually use the tag, since Chrome is now the default browser in Android 4+): <video width="640" height="360" preload="auto" controls src="rtsp://[ServerIP]:1935/vod/sample.mp4"> </video>

To support a desktop PC, either provide a link to download the src video tag (mp3, ogg, wav ..), or if you need to use the streaming protocol, you need to resort to a plugin like Flash (and feed it RTMP or HDS).

There is a VLC plugin for web browsers that allows you to play RTSP streams, but is located in the embed tag: <embed TYPE="application/x-vlc-plugin" autoplay="no" loop="no" width="640" height="360" target="rtsp://[ServerIP]:1935/vod/sample.mp4"></embed>

Although HTML5 video is an agnostic of the protocol, it depends on the implementation of the manufacturer of the web browser / OS and may vary depending on time and manufacturers.

+2
source
 <audio controls autoplay="autoplay"><source src="http://ip:port/;stream.mp3" type="audio/mp3">Your browser does not support the audio element.</audio> 

worked for me on ie10, ff-chrome (win7) and android, iphone / ipad, im, waiting for testing on older screens, safari and opera. Will not work, i.e. eight.

-1
source

All Articles