简体   繁体   English

MJPEG Livestream导致页面永不停止加载

[英]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. 我目前正在树莓派上通过直播设置一个由wifi控制的小车。 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. 我从运行在pi上不同端口上的服务器上获取流,并使用简单的img标签嵌入video.mjpeg文件。 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. 问题在于,由于未触发window.onload,现在我的JavaScript无法启动。 Is there some simple workaround for this problem? 有一些解决此问题的简单方法吗?

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

I would suggest to use the jquery-clipchamp-mjpeg-player-plugin 我建议使用jquery-clipchamp-mjpeg-player-plugin

Give this a try 试试这个

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM