demo.html
parent
de759ff0ca
commit
9e617b286a
|
|
@ -0,0 +1,33 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Demo</title>
|
||||
</head>
|
||||
<body>
|
||||
<video id="video"></video>
|
||||
</body>
|
||||
<script src="./flv.min.js"></script>
|
||||
<script>
|
||||
if (flvjs.isSupported()) {
|
||||
const video = document.getElementById('video');
|
||||
// rtsp 链接地址
|
||||
// 需要 base64 加密, 需要 base64 加密, 需要 base64 加密
|
||||
const url = 'rtsp://admin:lcdx12345@117.176.117.148:554/Streaming/Channels/101';
|
||||
// const url = "{{ base64_encode('rtsp://admin:lcdx12345@117.176.117.148:554/Streaming/Channels/101') }}"
|
||||
const player = flvjs.createPlayer({
|
||||
type: 'flv',
|
||||
isLive: true,
|
||||
url: 'ws://183.221.204.29:8100/rtsp?url=' + url
|
||||
})
|
||||
player.on('error', (e) => {
|
||||
console.log(e)
|
||||
})
|
||||
player.attachMediaElement(video)
|
||||
player.load()
|
||||
player.play()
|
||||
}
|
||||
</script>
|
||||
</html>
|
||||
Loading…
Reference in New Issue