How to stream via RTSP or RTP in HTML5?

Spread the love

Sometimes, we want to stream via RTSP or RTP in HTML5.

In this article, we’ll look at how to stream via RTSP or RTP in HTML5.

How to stream via RTSP or RTP in HTML5?

To stream via RTSP or RTP in HTML5, we set the src attribute of the video element to the stream URL.

For instance, we write

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

to add a video element with the src attribute set to the stream URL.

Then it’ll play in the browser.

Conclusion

To stream via RTSP or RTP in HTML5, we set the src attribute of the video element to the stream URL.

Leave a Reply

Your email address will not be published. Required fields are marked *