h5.html 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. <!DOCTYPE html>
  2. <html lang=zh-CN>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="divport" content="width=device-width,user-scalable=no,initial-scale=1,maximum-scale=1,minimum-scale=1">
  7. <title>uni-app h5平台在电脑浏览器打开解决方案</title>
  8. <meta name="Copyright" content="helang">
  9. <link rel="shortcut icon" type="image/png" href="/uniapp-extend/static/logo.png">
  10. <meta name="keywords" content="黄河爱浪,WEB前端河浪,jQuery插件开发者河浪">
  11. <meta name="description" content="公众号:web-7258,QQ:1846492969,邮箱:helang.love@qq.com">
  12. <style type="text/css">
  13. body {
  14. margin: 0;
  15. background-color: #f3f3f3;
  16. }
  17. iframe {
  18. width: 375px;
  19. height: 667px;
  20. background-color: #fff;
  21. box-sizing: content-box;
  22. border: none;
  23. }
  24. @media screen and (min-width: 450px) {
  25. iframe {
  26. position: fixed;
  27. top: 0;
  28. right: 0;
  29. bottom: 0;
  30. left: 0;
  31. margin: auto;
  32. border: rgba(0, 0, 0, 0.7) solid 10px;
  33. border-radius: 4px;
  34. }
  35. }
  36. </style>
  37. <script type="text/javascript" src="./js/ezuikit.js"></script>
  38. <script type="text/javascript">
  39. window.onload = function() {
  40. /* 监听电脑浏览器窗口尺寸改变 */
  41. // window.onresize = function(){
  42. // /* 窗口宽度 小于或等于420px 时,跳转回H5页面 */
  43. // if(window.innerWidth <= 420){
  44. // // window.location.pathname = '/uniapp-extend';
  45. // /* 若你的项目未设置根目录(默认为 / 时),则使用下方代码 */
  46. // // window.location.pathname = '';
  47. // }
  48. //
  49. var obj=JSON.parse(localStorage.getItem('obj'))
  50. console.log(obj)
  51. var accessToken=obj.accessToken
  52. var device_id=obj.device_id
  53. // let name = window.parent.document.getElementsByTagName("iframe")[0].baseURI; //需要iframe的ID
  54. // console.log(name)
  55. setTimeout(() => {
  56. var url = "ezopen://open.ys7.com/"+device_id+"/1.hd.live"
  57. var player = new EZUIKit.EZUIPlayer({
  58. id: 'myPlayer',
  59. url: url,
  60. autoplay: true,
  61. accessToken: accessToken,
  62. decoderPath: 'js/',
  63. width: 600,
  64. height: 400,
  65. });
  66. player.play();
  67. }, 500)
  68. }
  69. </script>
  70. </head>
  71. <body>
  72. <!-- <iframe src="/uniapp-extend"></iframe> -->
  73. <div id="myPlayer"></div>
  74. <div class="btn-box">
  75. <div class="more" @touchstart="configCamera('move', 8)" @touchend="stopConfigCamera()">
  76. <!-- <image src="" :src="moreSrc" mode="widthFix"></image> -->
  77. </div>
  78. <div class="direc">
  79. <div class="top" @touchstart="configCamera('move', 0)" @touchend="stopConfigCamera()">
  80. </div>
  81. <div class="bottom" @touchstart="configCamera('move', 1)" @touchend="stopConfigCamera()">
  82. </div>
  83. <div class="photo" @touchstart="configCamera('takephoto', '')" >
  84. </div>
  85. <div class="left" @touchstart="configCamera('move', 2)" @touchend="stopConfigCamera()">
  86. </div>
  87. <div class="right" @touchstart="configCamera('move', 6)" @touchend="stopConfigCamera()">
  88. </div>
  89. </div>
  90. <div class="less" @touchstart="configCamera('move', 9)" @touchend="stopConfigCamera()">
  91. <image :src="lessSrc" mode="widthFix"></image>
  92. </div>
  93. </div>
  94. <!--
  95. 若你的项目未设置根目录(默认为 / 时),则使用下方代码
  96. <iframe src="/"></iframe>
  97. -->
  98. </body>
  99. </html>