Comments (6)
经过实测,使用以下代码可以在chrome浏览器播放ZLMediaKit生成的hls视频:
<head>
<link href="https://vjs.zencdn.net/7.3.0/video-js.css" rel="stylesheet">
<!-- If you'd like to support IE8 (for Video.js versions prior to v7) -->
<script src="https://vjs.zencdn.net/ie8/ie8-version/videojs-ie8.min.js"></script>
</head>
<body>
<video id="my-video" class="video-js" controls preload="auto" width="640" height="264"
poster="MY_VIDEO_POSTER.jpg" data-setup="{}">
<source src="http://127.0.0.1/live/0/hls.m3u8" type='application/vnd.apple.mpegurl'>
<p class="vjs-no-js">
To view this video please enable JavaScript, and consider upgrading to a web browser that
<a href="https://videojs.com/html5-video-support/" target="_blank">supports HTML5 video</a>
</p>
</video>
<script src="https://vjs.zencdn.net/7.3.0/video.js"></script>
</body>
from zlmediakit.
你是推流还是拉流之后生成的hls文件?能否说下你的应用场景
from zlmediakit.
我是拉取监控摄像头的rtsp流然后转成hls。前端用的vue+video.js播放,也尝试用了ckplayer网页播放器,都是播放不了
from zlmediakit.
你看下是否是跨域的问题?假如说你hls的服务器地址跟你播放页面的地址不一样 就可能存在跨域问题
from zlmediakit.
跨域的话js有提示的,浏览器上没有任何报错,同一个http服务器也是不行的,用ffmpeg 命令生成的hls可以播放
from zlmediakit.
经过实测,使用以下代码可以在chrome浏览器播放ZLMediaKit生成的hls视频:
<head> <link href="https://vjs.zencdn.net/7.3.0/video-js.css" rel="stylesheet"> <!-- If you'd like to support IE8 (for Video.js versions prior to v7) --> <script src="https://vjs.zencdn.net/ie8/ie8-version/videojs-ie8.min.js"></script> </head> <body> <video id="my-video" class="video-js" controls preload="auto" width="640" height="264" poster="MY_VIDEO_POSTER.jpg" data-setup="{}"> <source src="http://127.0.0.1/live/0/hls.m3u8" type='application/vnd.apple.mpegurl'> <p class="vjs-no-js"> To view this video please enable JavaScript, and consider upgrading to a web browser that <a href="https://videojs.com/html5-video-support/" target="_blank">supports HTML5 video</a> </p> </video> <script src="https://vjs.zencdn.net/7.3.0/video.js"></script> </body>
好用 这个测试了
from zlmediakit.
Related Issues (20)
- [BUG] 删除录像文件成功,但是文件还是存在 HOT 24
- 国标拉流崩溃,大概率出现 HOT 1
- [BUG] docker执行MediaServer OBS无法正常推流 HOT 3
- [技术咨询] log中反复出现一个未知ip的WebRtcSession报错 HOT 2
- 最新代码 国标拉流崩溃 HOT 2
- [技术咨询] WebSocketClient是否支持切换opcode HOT 4
- 是否有arm架构服务器的docker版本镜像或者安装包 HOT 3
- [技术咨询] 使用C++ API的方式二次开发 发现了rtsp播放偶发画面卡死的现象 HOT 2
- [BUG] 点播端口分配异常 HOT 4
- webrtc播放,chrome和edge都无法播放,有响应,但是无画面 HOT 12
- 使用webrtc无法进行对讲 HOT 3
- [技术咨询] 录制视频回看
- 运行项目webrtc testplay,不能正常播放,提示连接失败 HOT 2
- 拉流rtsp需要提供用户名密码 HOT 2
- webrtc服务,在ubantu搭建服务器,浏览器端播放正常,在安卓手机端播放显示超时
- [技术咨询] ZLM有支持Slice解码吗? HOT 2
- [技术咨询] build_docker_images.sh 编译失败 HOT 2
- Unsupported mpeg: 6 HOT 3
- [技术咨询] 多次调用addStreamProxy创建多个代理加拉流地址的问题 HOT 1
- [技术咨询] RTP推流失败,视频源为海康摄像头 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zlmediakit.