javascript 使用 video.js 在 html 站点中包含 MJPEG

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/34023548/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-28 17:08:16  来源:igfitidea点击:

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

javascripthtmlvideo.jsmjpeg

提问by F. Daniel

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!

这是我的情况:我从 Web 服务器获取流。此流的格式为 MJPEG。我使用以下代码将此流嵌入到 html 站点中:<img src="http://172.17.52.161:9000/stream/video.mjpeg">,但我想为此流使用播放器。是否有可能将 video.js 与 mjpeg-streams 一起使用?我的总体目标是使用 Phonegap-Build 编译这些文件,以便在我的智能手机上使用它,这可能吗?谢谢您的帮助!

采纳答案by scaisEdge

You can use an <video>tag

您可以使用<video>标签

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