45 lines
1.3 KiB
HTML
45 lines
1.3 KiB
HTML
<!doctype html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>H5 PC测试</title>
|
|
<link href="css/video-js.css" rel="stylesheet">
|
|
<script src="js/video.min.js"></script>
|
|
<script src="js/videojs-contrib-hls.js"></script>
|
|
<style>
|
|
body{background-color: #191919}
|
|
|
|
#example-video{
|
|
margin: 0 auto;
|
|
width: 80%;
|
|
height:600px;
|
|
}
|
|
</style>
|
|
</head>
|
|
|
|
<body>
|
|
<div>
|
|
<h1 style="color: white; text-align: center;">HLS测试</h1>
|
|
<video id="example-video" class="video-js" autoplay="autoplay" controls preload="auto"
|
|
width="600" height="800" >
|
|
<!-- <source src="http://193.112.101.157:8080/hls/test.m3u8" type="application/x-mpegURL" /> -->
|
|
<!-- <source src="http://60.190.97.190:83/openUrl/LpSobcI/live.m3u8" type="application/x-mpegURL"> -->
|
|
<source :src="url" type="application/x-mpegURL">
|
|
</video>
|
|
</div>
|
|
</body>
|
|
<script>
|
|
window.onload = function() {
|
|
var player = videojs('example-video');
|
|
player.play();
|
|
},
|
|
function getQueryString(name) {
|
|
var reg = new RegExp("(^|&)" + name + "=([^'']*)(&|$)", "i");
|
|
// var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
|
|
var r = window.location.search.substr(1).match(reg);
|
|
if (r != null) return unescape(r[2]); return null;
|
|
}
|
|
console.log();
|
|
</script>
|
|
</html>
|