Include a MJPEG in a html-Site, using video.js

F. Daniel picture F. Daniel · Dec 1, 2015 · Viewed 17.9k times · Source

Here's my case: I get a Stream from a Web-Server. The format of this Stream is MJPEG. I embedded this stream in a html-site with the following code: <img src="http://172.17.52.161:9000/stream/video.mjpeg">, but I'd like to use a Player for this stream. Is there a possibility to use video.js with mjpeg-streams? My overall goal is to compile these files with Phonegap-Build, to use it on my Smartphone, is this possible? Thank you for your help!

Answer

scaisEdge picture scaisEdge · Dec 1, 2015

You can use an <video> tag

<video src="http://172.17.52.161:9000/stream/video.mjpeg" controls>
   Your browser does not support the <code>video</code> element.
</video>