Repair HLS black screen And Repair loading

This commit is contained in:
Sake
2021-01-13 10:09:29 +08:00
parent b0442058e0
commit 925781a508
5 changed files with 78 additions and 9494 deletions

File diff suppressed because one or more lines are too long

View File

@@ -164,16 +164,18 @@ play(url,autoplay,currentTime)
## 事件 ## 事件
| 方法名 | 说明 | 参数 | | 方法名 | 说明 | 参数 |
| ---------- | ------------ | --------------------- | | ---------- | ------------ | --------------------- |
| play | 播放事件 | url:'流地址',autoplay: '自动播放',currentTime:'开始时间' | | play | 播放事件 | url:'流地址',autoplay: '自动播放',currentTime:'开始时间' |
| pause | 播放暂停 | - | | pause | 播放暂停 | - |
| destroy | 停止播放 | - | | destroy | 停止播放 | - |
| openAudio | 打开声音 | - | | openAudio | 打开声音 | - |
| closeAudio | 关闭声音 | - | | closeAudio | 关闭声音 | - |
| startLoding | 开始加载动画 | - | | startLoading | 开始加载动画 | - |
| endLoding | 结束加载动画 | - | | endLoading | 结束加载动画 | - |
| fullScreen | 开启或退出全屏 | - | | fullScreen | 开启或退出全屏 | - |
| setSnap | 设置封面照 | 封面图片地址 |
| endSnap | 清除封面照 | - |
<br/> <br/>

File diff suppressed because one or more lines are too long

View File

@@ -12,17 +12,11 @@
<h4 style="width:600px;margin: auto;">H265播放器</h4> <h4 style="width:600px;margin: auto;">H265播放器</h4>
<br> <br>
<div style="width:600px;height: 400px; background-color:pink;margin: auto;"> <div style="width:600px;height: 400px; background-color:pink;margin: auto;">
<div id="newplay" onClick="onplay"></div> <div id="newplay" onClick="onplay" style="width:100%;height: 100%;"></div>
<p>列如http://127.0.0.1:8080/flv/hls/stream.flv <a href="http://www.easydarwin.org/easywasmplayer/" target="_blank"> 在线演示</a></p>
<p style="color:red;font-size: 12px;">注意:本实例需要以服务方式启动 <a href="https://blog.csdn.net/weixin_43194037/article/details/108885134" target="_blank">搭建服务教程</a></p>
<input type="text" id="value"> <input type="text" id="value">
<button id="btn">播放</button> <button id="btn">播放</button>
</div> </div>
<script> <script>
// 播放器回调函数
callbackfun = function (e) {
console.log(e);
}
// 播放按钮 // 播放按钮
var btn = document.getElementById('btn'); var btn = document.getElementById('btn');
// 地址栏 // 地址栏
@@ -36,7 +30,9 @@
player.play(value.value,1); player.play(value.value,1);
console.log(value.value); console.log(value.value);
} }
function callbackfun(e) {
console.log("回调数据e:",e);
}
</script> </script>
</body> </body>
</html> </html>

File diff suppressed because one or more lines are too long