javascript - Playing audio stream using html5 -
how can play rtsp streams html5 audio tag, check streaming links wowza http , rtsp both work on vlc when embed these links in html5 audio tag, nothing seems work appreciated. here 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 on smartphones perfectly, doesn't work on pc browsers
hls (m3u8 files) play on ios (and android support can clunky) , mac os safari in html5 audio tag: <video width="640" height="360" preload="auto" controls src="http://[serverip]:1935/vod/test.mp4/playlist.m3u8"></video>
rtsp can played on android via tag in chrome:
<div id="myelement"> <a href="rtsp://[serverip]:1935/vod/mp4:test.mp4">watch stream on rtsp</a> </div>
rtsp should work in html5 video tag on android on native browser (well experience of use tag chrome default browser in android 4+): <video width="640" height="360" preload="auto" controls src="rtsp://[serverip]:1935/vod/sample.mp4"> </video>
to support desktop pc, either provide download link video tag src (mp3, ogg, wav ..) or if have use streaming protocol need resort plugin flash (and feed rtmp or hds feed).
there vlc plugin web browsers can allow playback of rtsp streams in embed tag: <embed type="application/x-vlc-plugin" autoplay="no" loop="no" width="640" height="360" target="rtsp://[serverip]:1935/vod/sample.mp4"></embed>
though html5 video protocol agnostic dependent on web browser/os manufacturer implementation , can vary along time , manufacturers.
Comments
Post a Comment