52 lines
1.8 KiB
HTML
52 lines
1.8 KiB
HTML
<!doctype html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport"
|
|
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
|
|
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
|
<title>数字人直播</title>
|
|
<link href="https://web.sdk.qcloud.com/player/tcplayer/release/v5.2.0/tcplayer.min.css" rel="stylesheet"/>
|
|
<style>
|
|
*, :before, :after {
|
|
box-sizing: border-box;
|
|
border-width: 0;
|
|
border-style: solid;
|
|
}
|
|
body{
|
|
margin: 0;
|
|
}
|
|
.wrapper{}
|
|
.wrapper .video-js{
|
|
max-width: 480px;
|
|
margin: auto;
|
|
height: 100vh;
|
|
}
|
|
.wrapper video{
|
|
height: 100vh;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="wrapper">
|
|
<video id="player-container" width="414" height="270" preload="auto" playsinline webkit-playsinline>
|
|
</video>
|
|
</div>
|
|
<!--播放器脚本文件-->
|
|
<script src="https://web.sdk.qcloud.com/player/tcplayer/release/v5.2.0/tcplayer.v5.2.0.min.js"></script>
|
|
<script>
|
|
function init(){
|
|
fetch('/api/v1/tencent/get_pull_url').then(r=>r.json()).then(ret=>{
|
|
console.log(ret)
|
|
TCPlayer('player-container', {
|
|
sources: [{
|
|
src: ret.data.flv_url, // 播放地址
|
|
}],
|
|
licenseUrl: 'https://license.vod2.myqcloud.com/license/v2/1328581896_1/v_cube.license', // license 地址,必传。参考准备工作部分,在视立方控制台申请 license 后可获得 licenseUrl
|
|
});
|
|
})
|
|
}
|
|
document.addEventListener('DOMContentLoaded', init);
|
|
</script>
|
|
</body>
|
|
</html> |