xgplayer
xgplayer copied to clipboard
西瓜xgplayer-hls 切换源,会显示error 页面
您使用的西瓜播放器版本是多少? What version of xgplayer are you using? xgplayer: 2.31.4 xgplayer-hls: 2.5.2
您使用的操作系统和浏览器分别是? What OS and browser are you using? chrome, mac os
如何复现问题? What did you do? 在 演示地址里 https://v2.h5player.bytedance.com/examples/ 播放hls 视频地址: 下面地址 切换地址: https://video.yunjilink.com/recordings/z1.yunji-live.5f1f8f79d384c73704e272bb/1596092571_1596095882.m3u8 以下是复现代码
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name=viewport content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no,minimal-ui">
<meta name="referrer" content="no-referrer">
<title>播放器</title>
<style type="text/css">
html, body {width:100%;height:100%;margin:auto;overflow: hidden;}
body {display:flex;}
#mse {flex:auto;}
</style>
<script type="text/javascript">
window.addEventListener('resize',function(){document.getElementById('mse').style.height=window.innerHeight+'px';});
</script>
</head>
<body>
<div id="mse"></div>
<div>
<button onclick="changeSrc()">>改变地址</button>
</div>
<script src="//cdn.jsdelivr.net/npm/[email protected]/browser/index.js" charset="utf-8"></script>
<script src="//cdn.jsdelivr.net/npm/xgplayer-hls/dist/index.min.js" charset="utf-8"></script>
<script type="text/javascript">
let player = new HlsPlayer({
id: 'mse',
url: '//sf1-cdn-tos.huoshanstatic.com/obj/media-fe/xgplayer_doc_video/hls/xgplayer-demo.m3u8',
autoplay: true,
playsinline: true,
height: window.innerHeight,
width: window.innerWidth
});
function changeSrc() {
var src = 'https://video.yunjilink.com/recordings/z1.yunji-live.5f1f8f79d384c73704e272bb/1596092571_1596095882.m3u8'
player.src = src
}
</script>
</body>
</html>
实际播放器的表现是? What actually happened? 点击"改变地址"按钮时,中途会显示error 页面: 【请 "刷新" 试试】
谢谢