美好的一天,我使用 esp8266 模块作为服务器,带有摄像头模块通过 wifi 连续传输 jpeg 图像。我想同时在同一个浏览器窗口中播放流视频、文本和按钮。所以我用 HTML 创建了网页,我使用“multipart/x-mixed-replace”内容类型作为流窗口、文本和按钮,因为我读到这种类型接受各种子类型,如 html 和图像。流媒体窗口有效,但...
总而言之,我想要做的是在同一个浏览器窗口中同时拥有流式视频窗口、文本和按钮。
下面是我编写的 HTML 代码和流窗口的图像,我相信我在内容类型上做错了或者我没有以正确的方式使用它。
HTTP/1.1 200 OK
Content-Type: multipart/x-mixed-replace; boundary=frame
--frame //this part shows the jpeg image captured
Content-Type: image/jpeg
..
fetch jpeg image part
..
--frame //this part hopefully adds text and buttons
Content-Type: text/html // along with the streaming video window
<!DOCTYPE HTML> //This is the idea at least...
<html>
<body>
<h1 style="position:relative; left:25px;"> ⚓ Observation Panel ⚓</h1> …Run Code Online (Sandbox Code Playgroud)