Search code examples
javascripthttp-live-streamingmjpeg

MJPEG Livestream causes the page to never stop loading


I am currently setting up a little wifi controlled car on my raspberry pi with a livestream. I am grabbing the stream from a server which runs on the pi on a different port, I am embedding the video.mjpeg file with a simple img tag. The stream works fine but the page doesnt stop loading (which makes somewhat sense of course). The problem is that now my javascript doesn't start because window.onload is not fired. Is there some simple workaround for this problem?

    <main>
        <img src="http://raspberrypi:8080/stream/video.mjpeg" id="stream" alt="stream" />
    </main>

Solution

  • I would suggest to use the jquery-clipchamp-mjpeg-player-plugin

    Give this a try