Visualize mjpeg-over-http streams in a browser using html5

Ok, I have a server that serves the motion-jpeg stream via http. What I would like to do is connect to the server and render the stream in the browser, preferably inside the canvas . The browser must be Safari Mobile.

Is it possible to take a stream with XMLHttpRequest, take out individual JPEG images and put them in a canvas element? Keep in mind that the flow is alive, possibly endless.

+4
source share
2 answers

iOs mobile Safari supports MJPEG natively on top of http. Is there a specific reason you need a canvas? see http://bridgecam2.halton.gov.uk/mjpg/video.mjpg?camera=1 on ipad / iphone

+2
source

Sorry to revive the old theme, but I ran into this problem and I didn’t want to use another player only in my native html5

I found one way to display video inside html5 with the attribute "poster"

 <video width="360" height="420" controls poster="/video" autoplay> <source src="/audio.ogg" type="audio/ogg" /> </video> 

It may not be what you expected, but it works.

+10
source

Source: https://habr.com/ru/post/1400037/


All Articles