appVideo.html 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>实时监控</title>
  6. <meta name="renderer" content="webkit">
  7. <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
  8. <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
  9. <meta http-equiv="pragma" content="no-cache">
  10. <meta http-equiv="Cache" content="no-cache">
  11. <meta http-equiv="cache-control" content="no-cache, must-revalidate">
  12. <meta http-equiv="expires" content="0">
  13. <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  14. <!--引入 element-ui 的样式,-->
  15. <link rel="stylesheet" href="../css/element.css">
  16. <link rel="stylesheet" href="../css/style.css">
  17. <link rel="stylesheet" href="../css/base.css">
  18. <script src="../js/jquery.min.js" type="text/javascript" charset="utf-8"></script>
  19. <script src="../js/ezuikit.js"></script>
  20. <script src="../js/yz/init.js"></script>
  21. </head>
  22. <style type="text/css">
  23. *{
  24. margin: 0;
  25. padding: 0;
  26. box-sizing: border-box;
  27. }
  28. body{
  29. height: 100vh;
  30. padding: 6px;
  31. background-color:#103151;
  32. overflow: hidden;
  33. }
  34. .videobox{
  35. position: relative;
  36. height: 220px;
  37. width: 100%;
  38. border:1px solid #00adad;
  39. }
  40. .videobox .noBg{
  41. position: absolute;
  42. height: 100%;
  43. width: 100%;
  44. z-index: 111;
  45. background: url(../imgs/novideo1.png) no-repeat;
  46. background-size: 100% 100%;
  47. }
  48. </style>
  49. <body>
  50. <div class="videobox">
  51. <div class="noBg"></div>
  52. <div style="height:220px" id="playWind"></div>
  53. </div>
  54. <div class="flex justify-around margin-top text-center Tool">
  55. <div><div class="iconfont icon-bofang text-xl text-bold text-blue"></div>播放</div>
  56. <div><div class="iconfont icon-shengyin-guan pauseVoice text-xl text-bold"></div>声音</div>
  57. <div><div class="iconfont icon-tuichu text-xl text-bold text-red"></div>关闭</div>
  58. </div>
  59. </body>
  60. <script type="text/javascript">
  61. var _Player = null,_playSn = null,_playNo = null,_acTok = null;
  62. var playSucc = false;
  63. $(document).ready(function(){
  64. let _key = window.location.search.split("&");
  65. _playSn = _key[0].split("=")[1];
  66. _playNo = _key[1].split("=")[1];
  67. _acTok = _key[2].split("=")[1];
  68. playEzopen();
  69. setTimeout(()=>{
  70. _Player.stop();
  71. playEzopen();
  72. },2000)
  73. })
  74. function playEzopen(){
  75. if(_Player != null){
  76. _Player.stop();
  77. }
  78. if(_playSn==undefined||_playSn==null||_playSn==""){
  79. return;
  80. }
  81. if(_playNo==undefined||_playNo==null||_playNo==""){
  82. return;
  83. }
  84. if(_acTok==undefined||_acTok==null||_acTok==""){
  85. return;
  86. }
  87. let _wid = $(".videobox").width();
  88. let _hie = $(".videobox").height();
  89. $(".noBg").css("z-index",-1);
  90. let _src = "ezopen://open.ys7.com/"+_playSn+"/"+_playNo+".live";
  91. _Player = new EZUIKit.EZUIPlayer({
  92. id: 'playWind',
  93. autoplay: true,
  94. url: _src,
  95. template: 'theme',
  96. accessToken: _acTok,
  97. width:_wid,
  98. height:_hie,
  99. audio:1,
  100. footer:["hd","talk"],
  101. decoderPath: "http://192.168.4.242:32000/yzDemo",
  102. handleError: handleError,
  103. handleSuccess: handleSuccess,
  104. });
  105. }
  106. function handleError(){
  107. if(_Player != null){
  108. _Player.stop();
  109. }
  110. playSucc = false;
  111. _Player = null;
  112. $(".noBg").css("z-index",111);
  113. ShowLoading("视频播放失败!", 1);
  114. }
  115. function handleSuccess(){
  116. playSucc = true;
  117. }
  118. $(".Tool .icon-bofang").on("click","",function(){
  119. if(playSucc){
  120. ShowLoading("视频已在播放了!", 1);
  121. }else{
  122. playEzopen();
  123. }
  124. })
  125. // 静音、不静音
  126. $(".Tool .pauseVoice").on("click","",function(){
  127. if($(this).hasClass("icon-shengyin-kai")){
  128. _Player.closeSound();
  129. $(this).removeClass("icon-shengyin-kai").addClass("icon-shengyin-guan");
  130. }else{
  131. _Player.openSound();
  132. $(this).removeClass("icon-shengyin-guan").addClass("icon-shengyin-kai");
  133. }
  134. })
  135. $(".Tool .icon-tuichu").on("click","",function(){
  136. if(_Player != null){
  137. _Player.stop();
  138. _Player = null;
  139. playSucc = false;
  140. $(".Tool .pauseVoice").removeClass("icon-shengyin-kai").addClass("icon-shengyin-guan");
  141. $(".noBg").css("z-index",111);
  142. }
  143. })
  144. </script>
  145. </html>