12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8" />
- <title>视频预览</title>
- <link href="./css/video.css" rel="stylesheet">
- <script src="./js/video.js"></script>
- <script src="./js/videojs-live.js"></script>
- <style>
- html,body{height:100%}
- * { box-sizing: initial }
- </style>
- </head>
- <body style="margin: 0;" onload="init()">
- <div id="video" class="video-coverInfo-template" style="width:100%;height:100%;">
- <!-- <video id="my_video_1" autoplay="autoplay" loop="loop" muted="muted" class="video-js vjs-default-skin"
- controls preload="auto" width="320" height="240" data-setup='{}'>
- <source src="http://183.230.61.217:8093/hls/sbltbz.m3u8" type="application/x-mpegURL">
- </video> -->
- </div>
- <!-- <script src="./js/jQ.js"></script> -->
- <script type="text/javascript">
- // $(function () {
- // //初始化IP地址、端口、用户名、密码、宽度高度
- // var _url = queryString("url");
- // var _iWidth = queryString("width") || "800";
- // var _iHeight = queryString("height") || "600";
- // document.getElementById('video').innerHTML =
- // '<video id="my_video_1" autoplay="autoplay" loop="loop" muted="muted" class="video-js vjs-default-skin" controls preload="auto"' +
- // ' style="width:100%;height:100%" data-setup="{}"><source src="' + _url + '" type="application/x-mpegURL"></video>'
-
- // });
- // function queryString(val) {
- // var uri = window.location.search;
- // var re = new RegExp("" + val + "\=([^\&\?]*)", "ig");
- // return ((uri.match(re)) ? decodeURIComponent((uri.match(re)[0].substr(val.length + 1))) : null);
- // }
- function init() {
- var url = window.location.search.substring(1);
- var vars = {}
- url.split("&").map((e) => {
- var att = e.split("=")
- vars[att[0]] = att[1]
- })
- url = vars['url']
- if(url != '')
- document.getElementById('video').innerHTML =
- '<video id="my_video_1" autoplay="autoplay" loop="loop" muted="muted" class="video-js vjs-default-skin" controls preload="auto"' +
- ' style="width:100%;height:100%" data-setup="{}"><source src="' + vars['url'] + '" type="application/x-mpegURL"></video>'
- else
- document.getElementById('video').innerHTML =
- '<img src="./image/nullVideo.png" style="position: absolute;left: 50%;top: 50%;transform: translate(-50%, -50%);"/>' //'<div style="background:url(./image/nullVideo.png);background-size:100% 100%;width:100%;height:100%;"></div>'
- }
- </script>
- </body>
- </html>
|