123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <title>实时监控</title>
- <meta name="renderer" content="webkit">
- <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
- <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
- <meta http-equiv="pragma" content="no-cache">
- <meta http-equiv="Cache" content="no-cache">
- <meta http-equiv="cache-control" content="no-cache, must-revalidate">
- <meta http-equiv="expires" content="0">
- <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
-
- <!--引入 element-ui 的样式,-->
- <link rel="stylesheet" href="../css/element.css">
- <link rel="stylesheet" href="../css/style.css">
- <link rel="stylesheet" href="../css/base.css">
- <script src="../js/jquery.min.js" type="text/javascript" charset="utf-8"></script>
- <script src="../js/ezuikit.js"></script>
- <script src="../js/yz/init.js"></script>
- </head>
- <style type="text/css">
- *{
- margin: 0;
- padding: 0;
- box-sizing: border-box;
- }
- body{
- height: 100vh;
- padding: 6px;
- background-color:#103151;
- overflow: hidden;
- }
- .videobox{
- position: relative;
- height: 220px;
- width: 100%;
- border:1px solid #00adad;
- }
- .videobox .noBg{
- position: absolute;
- height: 100%;
- width: 100%;
- z-index: 111;
- background: url(../imgs/novideo1.png) no-repeat;
- background-size: 100% 100%;
- }
- </style>
- <body>
- <div class="videobox">
- <div class="noBg"></div>
- <div style="height:220px" id="playWind"></div>
- </div>
- <div class="flex justify-around margin-top text-center Tool">
- <div><div class="iconfont icon-bofang text-xl text-bold text-blue"></div>播放</div>
- <div><div class="iconfont icon-shengyin-guan pauseVoice text-xl text-bold"></div>声音</div>
- <div><div class="iconfont icon-tuichu text-xl text-bold text-red"></div>关闭</div>
- </div>
- </body>
- <script type="text/javascript">
- var _Player = null,_playSn = null,_playNo = null,_acTok = null;
- var playSucc = false;
- $(document).ready(function(){
- let _key = window.location.search.split("&");
- _playSn = _key[0].split("=")[1];
- _playNo = _key[1].split("=")[1];
- _acTok = _key[2].split("=")[1];
- playEzopen();
- setTimeout(()=>{
- _Player.stop();
- playEzopen();
- },2000)
- })
- function playEzopen(){
- if(_Player != null){
- _Player.stop();
- }
- if(_playSn==undefined||_playSn==null||_playSn==""){
- return;
- }
- if(_playNo==undefined||_playNo==null||_playNo==""){
- return;
- }
- if(_acTok==undefined||_acTok==null||_acTok==""){
- return;
- }
- let _wid = $(".videobox").width();
- let _hie = $(".videobox").height();
- $(".noBg").css("z-index",-1);
- let _src = "ezopen://open.ys7.com/"+_playSn+"/"+_playNo+".live";
- _Player = new EZUIKit.EZUIPlayer({
- id: 'playWind',
- autoplay: true,
- url: _src,
- template: 'theme',
- accessToken: _acTok,
- width:_wid,
- height:_hie,
- audio:1,
- footer:["hd","talk"],
- decoderPath: "http://192.168.4.242:32000/yzDemo",
- handleError: handleError,
- handleSuccess: handleSuccess,
- });
- }
- function handleError(){
- if(_Player != null){
- _Player.stop();
- }
- playSucc = false;
- _Player = null;
- $(".noBg").css("z-index",111);
- ShowLoading("视频播放失败!", 1);
- }
- function handleSuccess(){
- playSucc = true;
- }
- $(".Tool .icon-bofang").on("click","",function(){
- if(playSucc){
- ShowLoading("视频已在播放了!", 1);
- }else{
- playEzopen();
- }
- })
- // 静音、不静音
- $(".Tool .pauseVoice").on("click","",function(){
- if($(this).hasClass("icon-shengyin-kai")){
- _Player.closeSound();
- $(this).removeClass("icon-shengyin-kai").addClass("icon-shengyin-guan");
- }else{
- _Player.openSound();
- $(this).removeClass("icon-shengyin-guan").addClass("icon-shengyin-kai");
- }
- })
-
- $(".Tool .icon-tuichu").on("click","",function(){
- if(_Player != null){
- _Player.stop();
- _Player = null;
- playSucc = false;
- $(".Tool .pauseVoice").removeClass("icon-shengyin-kai").addClass("icon-shengyin-guan");
- $(".noBg").css("z-index",111);
- }
- })
- </script>
- </html>
|