suyiScreen/public/flv/index.html

52 lines
2.2 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>视频监控</title>
<style>
video::-webkit-media-controls-timeline {
display: none;
}
</style>
</head>
<body style="margin:0px;width: 1000px;;height: 582px;overflow: hidden;z-index: 99;">
<script src="flv.min.js"></script>
<video id="videoElement" style="width: 1000px;height: 582px;" muted controls="controls"></video>
<script>
var a = getParam('name')
if (flvjs.isSupported()) {
var videoElement = document.getElementById('videoElement');
var flvPlayer = flvjs.createPlayer({
type: 'flv',
isLive: true,
// url: 'ws://172.16.1.209:8998/rtsp/1/channel=1&subtype=0/?url=rtsp://admin:5Gpmlabs@172.16.1.242:554/cam/realmonitor?channel=1&subtype=0'
// url: 'ws://223.112.17.26:12309/rtsp/1/channel=1&subtype=0/?url=rtsp://admin:5Gpmlabs@10.16.1.1:10086/cam/realmonitor'
// url: 'ws://172.16.1.21:12309/rtsp/1/a/?url=rtsp://127.0.0.1:12310/live/'+a
// url: 'ws://223.112.17.26:12309/rtsp/1/a/?url=rtsp://127.0.0.1:12310/live/'+a
// url: 'ws://223.112.17.26:12309/rtsp/1/channel=1&subtype=0/?url=rtsp://127.0.0.1:12310/live/'+a
url: 'ws://223.112.17.26:12309/rtsp/1/a/?url=rtsp://127.0.0.1:12310/live/' + a
});
flvPlayer.attachMediaElement(videoElement);
flvPlayer.load();
flvPlayer.play();
}
function getParam(name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
//search,查询?后面的参数,并匹配正则
var r = location.search.substr(1).match(reg);
let val = 'videoPlayer'
window.parent.postMessage({
val
}, '*')
if (r != null) return decodeURI(decodeURI(r[2]));
}
</script>
</body>
</html>