| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267 | 
							- <!doctype html>
 
- <html lang="en">
 
- <head>
 
-     <meta charset="UTF-8">
 
-     <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no">
 
-     <title>ImouPlayer</title>
 
-     <script src="./imouplayer.js"></script>
 
-     <style>
 
-         * {
 
-             /* font-family: PingFaangSC-Regular, Arial, 'Microsoft YaHei'; */
 
-             margin: 0;
 
-             padding: 0
 
-         }
 
-         
 
-         button {
 
-             display: block;
 
-             width: 120px;
 
-             line-height: 30px;
 
-             border: 1px solid #409eff;
 
-             background-color: #409eff;
 
-             color: #fff;
 
-             border-radius: 5px;
 
-             cursor: pointer;
 
-             margin-left: 73px;
 
-         }
 
-         
 
-         .wrap {
 
-             width: 80%;
 
-             max-width: 600px;
 
-             margin: 0 auto;
 
-         }
 
-         
 
-         .icon {
 
-             display: inline-block;
 
-             width: 20px;
 
-             line-height: 20px;
 
-             text-align: center;
 
-             background-color: #c1c1c1;
 
-             border-radius: 50%;
 
-             color: #fff;
 
-             font-style: normal;
 
-             cursor: pointer;
 
-             position: relative;
 
-             transition: background-color 0.3s ease;
 
-         }
 
-         
 
-         .tip {
 
-             display: block;
 
-             text-align: right;
 
-             font-size: 12px;
 
-             color: #999;
 
-         }
 
-         
 
-         @media only screen and (max-width: 768px) {
 
-             html,
 
-             body {
 
-                 padding: 0;
 
-                 margin: 0;
 
-             }
 
-             .wrap {
 
-                 width: 100%;
 
-             }
 
-             p {
 
-                 padding: 0 20px;
 
-             }
 
-         }
 
-     </style>
 
-     <script defer="defer" src="imouplayer.js"></script>
 
- </head>
 
- <body>
 
-     <div id="app"></div>
 
-     <div id="error"></div>
 
-     <script>
 
-         window.onload = function() {
 
-             let urlParams = getUrlParams(window.location.search);
 
-             console.log(urlParams);
 
-             let player;
 
-             let playerOption = {
 
-                 isEdit: false,
 
-                 url: urlParams.url || 'imou://open.lechange.com/6H0BXXXXXXX3D90/0/1?streamId=1',
 
-                 kitToken: urlParams.kitToken || 'Kt_3baccxxxxxxxxxxxxxxxxxxxxxa183e',
 
-                 // 是否自动播放
 
-                 autoplay: true,
 
-                 // 是否显示控制台
 
-                 controls: true,
 
-                 // 是否开启静音
 
-                 automute: true,
 
-                 themeData: [{
 
-                     area: 'header',
 
-                     fontColor: '#F18D00',
 
-                     backgroundColor: '#FFFFFF',
 
-                     activeButtonColor: '#0E72FF',
 
-                     buttonList: [{
 
-                         show: true,
 
-                         id: 'deviceName',
 
-                         name: '设备名称',
 
-                         position: 'left',
 
-                     }, {
 
-                         show: true,
 
-                         id: 'channalId',
 
-                         name: '设备通道',
 
-                         position: 'left',
 
-                     }, {
 
-                         show: true,
 
-                         id: 'cloudVideo',
 
-                         name: '云录像',
 
-                         position: 'right',
 
-                     }, {
 
-                         show: true,
 
-                         id: 'localVideo',
 
-                         name: '本地录像',
 
-                         position: 'right',
 
-                     }]
 
-                 }, {
 
-                     area: 'footer',
 
-                     fontColor: '#F18D00',
 
-                     backgroundColor: '#FFFFFF',
 
-                     activeButtonColor: '#0E72FF',
 
-                     buttonList: [{
 
-                         show: true,
 
-                         id: 'play',
 
-                         name: '播放',
 
-                         position: 'left',
 
-                     }, {
 
-                         show: true,
 
-                         id: 'mute',
 
-                         name: '音量控制',
 
-                         position: 'left',
 
-                     }, {
 
-                         show: true,
 
-                         id: 'talk',
 
-                         name: '语音对讲',
 
-                         position: 'left',
 
-                     }, {
 
-                         show: true,
 
-                         id: 'capture',
 
-                         name: '截图',
 
-                         position: 'left',
 
-                     }, {
 
-                         show: true,
 
-                         id: 'definition',
 
-                         name: '清晰度控制',
 
-                         position: 'right',
 
-                     }, {
 
-                         show: true,
 
-                         id: 'PTZ',
 
-                         name: '云台控制',
 
-                         position: 'right',
 
-                     }, {
 
-                         show: true,
 
-                         id: 'webExpend',
 
-                         name: '网页全屏',
 
-                         position: 'right',
 
-                     }, {
 
-                         show: true,
 
-                         id: 'extend',
 
-                         name: '全屏控制',
 
-                         position: 'right',
 
-                     }]
 
-                 }],
 
-             };
 
-             // 填写默认值
 
-             function $(selector) {
 
-                 return document.querySelector(selector);
 
-             }
 
-             document.body.addEventListener('touchmove', function(e) {
 
-                 e.preventDefault();
 
-                 console.log('禁止拖动');
 
-             }, {
 
-                 passive: false
 
-             });
 
-             function getUrlParams(data) {
 
-                 let paramsList = {};
 
-                 let paramsString = data.slice(1);
 
-                 let list
 
-                 if (paramsString.indexOf('%7C') != -1) {
 
-                     list = paramsString.split('%7C');
 
-                 } else {
 
-                     list = paramsString.split('|');
 
-                 }
 
-                 list.forEach(item => {
 
-                     let list = item.split('=');
 
-                     key = list.shift();
 
-                     value = list.join('=');
 
-                     paramsList[key] = value;
 
-                 })
 
-                 return paramsList
 
-             }
 
-             function initLive() {
 
-                 if (player) {
 
-                     player.destroy()
 
-                 }
 
-                 player = new ImouPlayer('#app');
 
-                 // const url = $('#url').value.trim();
 
-                 // const kitToken = $('#kitToken').value.trim();
 
-                 const url = playerOption.url;
 
-                 const kitToken = playerOption.kitToken;
 
-                 const urlArr = [];
 
-                 url.split('%').forEach(function(item, index) {
 
-                     const obj = {
 
-                         url: item,
 
-                         kitToken: kitToken,
 
-                         talk: {
 
-                             success: (msg) => {
 
-                                 console.log('type', msg)
 
-                             },
 
-                             failed: (msg) => {
 
-                                 console.log('failed', msg)
 
-                             }
 
-                         }
 
-                     };
 
-                     urlArr.push(obj)
 
-                 });
 
-                 // const width = window.innerWidth;
 
-                 const width = checkMobile() ? $('body').clientWidth : window.innerWidth;
 
-                 console.log(width);
 
-                 const height = checkMobile() ? parseInt(width * 9 / 16) : window.innerHeight;
 
-                 // const height = window.innerHeight;
 
-                 const params = {
 
-                     src: urlArr,
 
-                     width: width,
 
-                     height: height,
 
-                     isEdit: playerOption.isEdit,
 
-                     autoplay: playerOption.autoplay,
 
-                     controls: playerOption.controls,
 
-                     automute: playerOption.automute,
 
-                     themeData: playerOption.themeData
 
-                 };
 
-                 // console.log(params, '11111111111111111111111111');
 
-                 player.setup(params);
 
-             };
 
-             function checkMobile() {
 
-                 if (!navigator) return false;
 
-                 const reg = /(iPhone|iPod|Android|ios|SymbianOS)/i;
 
-                 return reg.test(navigator.userAgent);
 
-             }
 
-             (function() {
 
-                 initLive();
 
-             })();
 
-             // $('#init').onclick = function() {
 
-             //         initLive();
 
-             //     }
 
-             // $('#startTalk').onclick = function() {
 
-             //     player.startTalk()
 
-             // }
 
-             // $('#stopTalk').onclick = function() {
 
-             //     player.stopTalk()
 
-             // }
 
-         };
 
-     </script>
 
- </body>
 
- </html>
 
 
  |