赣州市洪水风险预警系统二维版本
xiebin
2023-03-02 b39483c96ae572121d3c619c0b9d37634e682cc4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, shrink-to-fit=no">
        <title>ByDansin</title>
        <meta name="format-detection" content="telephone=no">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <meta name="msapplication-tap-highlight" content="no">
        <style>
            html, body {
                margin: 0;
                padding: 0;
                height: 100%;
            }
            .vcp-error-tips {
                color: #fff;
            }
            #video-container {
                width: 100%;
                height: 100%;
            }
        </style>
    </head>
    <body>
        <div id="video-container" style="margin: 0px auto;"></div>
        <script src="https://imgcache.qq.com/open/qcloud/video/vcplayer/TcPlayer-2.3.2.js"></script>
        <script>
            // 获取url
            function getParams(name) {
                var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
    
                var r = window.location.search.substr(1).match(reg);
                if (r != null) {
                    return decodeURIComponent(r[2]);
                }
                return null;
            }
            var url = getParams('url');
            /**
             * 视频类型播放优先级
             * mobile :m3u8>mp4
             * PC :RTMP>flv>m3u8>mp4
             */    
            var options = {
                m3u8: url || 'http://hls01open.ys7.com/openlive/d6466d56c2184cb09f9be0fe05fda81f.m3u8' ,
                autoplay: true,
                wording: {
                    2032: '请求视频失败,请检查网络',
                    2048: '请求m3u8文件失败,可能是网络错误或者跨域问题'
                },
                listener: function (msg) {
                    if(msg.type == 'load') {
                        
                    }
                }
            };
            window.tcplayer = new TcPlayer('video-container', options);
        </script>
    </body>
</html>