videohtmlstreamingrtsprtp

Streaming via RTSP or RTP in HTML5


I'm building a web app that should play back an RTSP/RTP stream from a server http://lscube.org/projects/feng.

Does the HTML5 video/audio tag support the rtsp or rtp? If not, what would the easiest solution be? Perhaps drop down to a VLC plugin or something like that.


Solution

  • Technically 'Yes'

    (but not really...)

    HTML 5's <video> tag is protocol agnostic—it does not care. You place the protocol in the src attribute as part of the URL. E.g.:

    <video src="rtp://myserver.com/path/to/stream">
        Your browser does not support the VIDEO tag and/or RTP streams.
    </video>
    

    or maybe

    <video src="http://myserver.com:1935/path/to/stream/myPlaylist.m3u8">
        Your browser does not support the VIDEO tag and/or RTP streams.
    </video>
    

    That said, the implementation of the <video> tag is browser specific. Since it is early days for HTML 5, I expect frequently changing support (or lack of support).

    From the W3C's HTML5 spec (The video element):

    User agents may support any video and audio codecs and container formats