WXtrialInterface.html 26 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title></title>
  6. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  7. <meta name="viewport" content="initial-scale=1,maximum-scale=1, minimum-scale=1,user-scalable=no">
  8. <meta name="x5-orientation" content="portrait" />
  9. <meta name="screen-orientation" content="portrait" />
  10. <meta name="viewport" content="width=device-width, minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
  11. <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
  12. <meta name="apple-mobile-web-app-capable" content="yes">
  13. <meta name="apple-mobile-web-app-status-bar-style" content="black">
  14. <meta name="format-detection" content="telephone=no, email=no">
  15. <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
  16. <meta name="apple-mobile-web-app-capable" content="yes">
  17. <!-- 删除苹果默认的工具栏和菜单栏 -->
  18. <meta name="apple-mobile-web-app-status-bar-style" content="black">
  19. <!-- 设置苹果工具栏颜��? -->
  20. <meta name="format-detection" content="telphone=no, email=no">
  21. <!-- 忽略页面中的数字识别为电话,忽略email识别 -->
  22. <!-- 启用360浏览器的极速模��?(webkit) -->
  23. <meta name="renderer" content="webkit">
  24. <!-- 避免IE使用兼容模式 -->
  25. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  26. <!-- 针对手持设备优化,主要是针对一些老的不识别viewport的浏览器,比如黑��? -->
  27. <meta name="HandheldFriendly" content="true">
  28. <!-- 微软的老式浏览��? -->
  29. <meta name="MobileOptimized" content="320">
  30. <!-- uc强制竖屏 -->
  31. <!-- <meta name="screen-orientation" content="portrait"> -->
  32. <!-- QQ强制竖屏 -->
  33. <!-- <meta name="x5-orientation" content="portrait"> -->
  34. <!-- 不能旋转,问题出在这 -->
  35. <!-- UC强制全屏 -->
  36. <meta name="full-screen" content="yes">
  37. <!-- QQ强制全屏 -->
  38. <meta name="x5-fullscreen" content="true">
  39. <!-- UC应用模式 -->
  40. <meta name="browsermode" content="application">
  41. <!-- QQ应用模式 -->
  42. <meta name="x5-page-mode" content="app">
  43. <!-- windows phone 点击无高��? -->
  44. <meta name="msapplication-tap-highlight" content="no">
  45. <title></title>
  46. <style>
  47. body {
  48. font-size: .2592592593rem;
  49. margin: 0 auto;
  50. width: 100%;
  51. min-width: 320px;
  52. }
  53. .h-player {
  54. height: 100%;
  55. overflow: hidden;
  56. background: #000;
  57. }
  58. .container {
  59. width: 100%;
  60. height: 100%;
  61. position: relative;
  62. user-select: none;
  63. }
  64. #video1 {
  65. display: block;
  66. width: 100%;
  67. height: 100%;
  68. top: 0px;
  69. left: 0px;
  70. opacity: 1;
  71. }
  72. #box {
  73. width: 100%;
  74. height: 100%;
  75. position: absolute;
  76. left: 0;
  77. top: 0;
  78. z-index: 9999;
  79. /*width: 667px;
  80. height: 375px; http://192.168.31.8:8848/cloudmMobilePhone1.11/Player/trialInterface2.html
  81. position: absolute;
  82. left: -146px;
  83. top: 146px;
  84. background: red;*/
  85. /* transform: rotate(-90deg);*/
  86. /* opacity: 0.3;*/
  87. }
  88. .scroll {
  89. position: absolute;
  90. overflow: scroll;
  91. -webkit-overflow-scrolling: touch;
  92. top: 0;
  93. left: 0;
  94. bottom: 0;
  95. right: 0;
  96. }
  97. body:before {
  98. width: 100%;
  99. height: 100%;
  100. content: ' ';
  101. position: fixed;
  102. z-index: -1;
  103. top: 0;
  104. left: 0;
  105. background: #000;
  106. }
  107. #wine {
  108. user-select: none;
  109. -webkit-user-drag: none;
  110. position: absolute;
  111. z-index: 0;
  112. /* visibility: hidden;*/
  113. }
  114. #video1 {
  115. /* transform: rotate(180deg);*/
  116. }
  117. canvas {
  118. display: block;
  119. width: 100%;
  120. height: 100%;
  121. z-index: 999;
  122. }
  123. /*主屏*/
  124. .control {
  125. width: 900px;
  126. overflow: hidden;
  127. margin: 0 auto;
  128. margin-top: 90px;
  129. margin-bottom: 17px;
  130. }
  131. .control-left-img {
  132. width: 26px;
  133. height: 26px;
  134. }
  135. .control-left-img img {
  136. width: 100%;
  137. height: 100%;
  138. }
  139. #mainScreen-main {
  140. /* overflow: hidden; */
  141. user-select: none;
  142. -webkit-user-drag: none;
  143. position: relative;
  144. z-index: 0;
  145. width: 100%;
  146. height: 100%;
  147. top: 0px;
  148. /* left: 652.667px; */
  149. /* left: 270PX; */
  150. /* transform-origin: 0% 0%; */
  151. background: #000;
  152. }
  153. #mocan {
  154. position: absolute;
  155. left: -269px;
  156. top: 2px;
  157. /* opacity: 0.2; */
  158. width: 901px;
  159. height: 555px;
  160. z-index: 9999;
  161. opacity: 0.7;
  162. }
  163. #no-ne {
  164. width: 100%;
  165. height: 100%;
  166. position: absolute;
  167. top: 0;
  168. background: #000000;
  169. z-index: 99999;
  170. font-size: 18px;
  171. color: #FFFFFF;
  172. text-align: center;
  173. }
  174. .no-ne-text {
  175. margin-top: 60%;
  176. }
  177. .no-ne-an {
  178. width: 171px;
  179. height: 47px;
  180. background: #eb6100;
  181. line-height: 47px;
  182. text-align: center;
  183. color: #FFFFFF;
  184. margin: 0 auto;
  185. margin-top: 20px;
  186. }
  187. .container .muted {
  188. position: absolute;
  189. right: .46296rem;
  190. top: .46296rem;
  191. z-index: 9999999;
  192. /*background: #000;*/
  193. border-radius: 50%;
  194. /* opacity: 0.5;*/
  195. }
  196. .muted {
  197. width: 2.62963rem;
  198. height: 2.62963rem;
  199. background-position: -1.78704rem -8.43519rem;
  200. }
  201. html {
  202. height: 100%
  203. }
  204. .control-right-img {
  205. width: 42px;
  206. height: 42px;
  207. margin: 0 auto;
  208. /* margin: 1rem; */
  209. margin-top: 0.6rem;
  210. }
  211. .control-right-img img {
  212. width: 100%;
  213. height: 100%;
  214. }
  215. .leftmains {
  216. width: 3.5rem;
  217. height: 100%;
  218. background: #333333;
  219. position: fixed;
  220. right: 0rem;
  221. top: 0;
  222. transition: all 0.2s ease-in;
  223. }
  224. .PictureQualityMain {
  225. margin-top: 3rem;
  226. }
  227. .PictureQuality {
  228. margin: 0 auto;
  229. width: 2.5rem;
  230. height: 1.8rem;
  231. line-height: 1.8rem;
  232. color: #fff;
  233. text-align: center;
  234. font-size: 15px;
  235. margin-top: 1rem;
  236. }
  237. .avit {
  238. background: rgba(255, 255, 255, 1);
  239. color: #000 !important;
  240. border-radius: 3px;
  241. }
  242. .upload {
  243. margin: 0 auto;
  244. width: 3rem;
  245. height: 1.8rem;
  246. line-height: 1.8rem;
  247. color: #fff;
  248. text-align: center;
  249. font-size: 16px;
  250. margin-top: 3rem;
  251. }
  252. .upload img {
  253. width: 1.5rem;
  254. height: 1.5rem;
  255. }
  256. .upload div {
  257. margin-top: -0.5rem;
  258. font-size: 14px;
  259. }
  260. .operation {
  261. margin-top: 9rem;
  262. }
  263. .bottommains {
  264. width: 100%;
  265. height: 50px;
  266. background: #333333;
  267. position: fixed;
  268. left: 0;
  269. bottom: 0;
  270. }
  271. .botmat1 {
  272. width: 33%;
  273. float: left;
  274. }
  275. .botmat1img {
  276. margin: 0 auto;
  277. width: 1.5rem;
  278. height: 1.5rem;
  279. margin-top: 0.5rem;
  280. }
  281. .botmat1img img {
  282. width: 100%;
  283. height: 100%;
  284. }
  285. .mainbox {
  286. width: 18rem;
  287. height: 10rem;
  288. background: #fff;
  289. position: fixed;
  290. top: 38%;
  291. left: 5%;
  292. border-radius: 5px;
  293. }
  294. .boxTitle {
  295. text-align: center;
  296. font-size: 18px;
  297. padding: 10px 0px;
  298. }
  299. .boxText {
  300. text-align: center;
  301. font-size: 16px;
  302. }
  303. .boxbt {
  304. width: 60%;
  305. height: 2.5rem;
  306. background: #0886F5;
  307. margin: 0 auto;
  308. font-size: 16px;
  309. text-align: center;
  310. line-height: 2.5rem;
  311. color: #fff;
  312. border-radius: 5px;
  313. margin-top: 1rem;
  314. }
  315. .sbox {
  316. width: 18rem;
  317. height: 5.5rem;
  318. background: #fff;
  319. position: fixed;
  320. top: 38%;
  321. left: 5%;
  322. border-radius: 5px;
  323. }
  324. .sboxText {
  325. padding: 17px;
  326. font-size: 16px;
  327. }
  328. .sboxbu {
  329. text-align: right;
  330. color: #0886F5;
  331. font-size: 16px;
  332. margin-right: 2rem;
  333. }
  334. .boximg {
  335. position: absolute;
  336. width: 1rem;
  337. height: 1rem;
  338. left: 45%;
  339. bottom: -22%;
  340. }
  341. #showsuss{
  342. display: none;
  343. }
  344. </style>
  345. </head>
  346. <body class="scroll h-player" style="overscroll-behavior: contain;">
  347. <div class="container" id="player">
  348. <div class="muted" id="btnMuted">
  349. <div class="control-right-img" data-id="1">
  350. <img src="../static/img/xuanfu_icon.png">
  351. </div>
  352. </div>
  353. <div id="wine">
  354. <video id="video1" muted="muted" x5-video-orientation="landscape" playsinline="true" autoplay="true" webkit-playsinline="true" x5-playsinline="true" x5-video-player-type="h5" x5-video-player-fullscreen="false" style="pointer-events: none;"></video>
  355. <div id="box"></div>
  356. </div>
  357. <div class="leftmains">
  358. <div class="PictureQualityMain">
  359. <div class="PictureQuality " data-id="3072000">高清</div>
  360. <div class="PictureQuality avit" data-id="2243000">标清</div>
  361. <div class="PictureQuality" data-id="400000">极速</div>
  362. <div class="PictureQuality" data-id="400000">自动</div>
  363. </div>
  364. <div class="operation">
  365. <div class="upload" id="showsuss" data-text="uploads">
  366. <img src="../static/img/wx/shangchuan_icon.png">
  367. <div>上传</div>
  368. </div>
  369. <div class="upload" onclick="cp(document.getElementById('user_ref_id'));" data-text="Shearplate">
  370. <img src="../static/img/wx/jianqieban_icon.png">
  371. <div>剪切板</div>
  372. </div>
  373. <div class="upload" id="upload" data-text="Signout">
  374. <img src="../static/img/wx/tuichu_icon.png">
  375. <div>退出</div>
  376. </div>
  377. </div>
  378. </div>
  379. <div class="bottommains">
  380. <div class="botmat1">
  381. <div class="botmat1img" data-text="gengduo">
  382. <img src="../static/img/wx/gengduo_icon.png">
  383. </div>
  384. </div>
  385. <div class="botmat1">
  386. <div class="botmat1img" data-text="home">
  387. <img src="../static/img/wx/home_icon.png">
  388. </div>
  389. </div>
  390. <div class="botmat1">
  391. <div class="botmat1img" data-text="return">
  392. <img src="../static/img/wx/fanhui_icon.png">
  393. </div>
  394. </div>
  395. </div>
  396. <div class="mainbox" style="display: none;">
  397. <div class="boxTitle">提示</div>
  398. <div class="boxText">
  399. <div>由于小程序的功能限制,此功能暂时</div>
  400. <div>无法使用,请下载APP使用更多功能</div>
  401. </div>
  402. <div class="boxbt" onclick="cp(document.getElementById('user_ref_id'));">立即前往下载</div>
  403. <div class="boximg"><img src="../static/img/wx/guanbi_icon.png"></div>
  404. </div>
  405. <div class="sbox" style="display: none;">
  406. <div class="sboxText">下载地址已复制到剪切板</div>
  407. <div class="sboxbu">确定</div>
  408. </div>
  409. </div>
  410. <div id="copy-txt" style="position: absolute;opacity: 0;">
  411. <span id="user_ref_id">www.androidsCloud.com</span>
  412. </div>
  413. <script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.3.2.js"></script>
  414. <script src="../static/js/jquery-1.11.0.min.js"></script>
  415. <!-- 音频-->
  416. <script src="../static/js/classlist.js"></script>
  417. <script src="../static/js/players.js"></script>
  418. <script src="../static/js/auroraplayer.js"></script>
  419. <script src="../static/js/aurora.js"></script>
  420. <script src="../static/js/aac.js"></script>
  421. <script src="../static/js/web.js?id=101"></script>
  422. <!-- <script src="../static/js/webapk.js"></script> -->
  423. <!-- 视频-->
  424. <script type="text/javascript" src="../static/js/Decoder.js"></script>
  425. <script type="text/javascript" src="../static/js/YUVCanvas.js"></script>
  426. <script type="text/javascript" src="../static/js/Player.js"></script>
  427. <script src="https://cdn.bootcss.com/vConsole/3.2.0/vconsole.min.js"></script>
  428. <script src="../static/distss/WXdraw.js?id=105"></script>
  429. <script>
  430. // document.addEventListener('touchstart', function() {
  431. // console.log("我主动的play()了");
  432. // players.play();
  433. // players.startPlaying();
  434. // var messageData = new Uint8Array(se)
  435. // player.decode(messageData);
  436. // // return this.asset.start(false);
  437. // this.playing = true;
  438. // });
  439. // window.addEventListener('click', playAudio, false);
  440. // function playAudio(obj) {
  441. // console.log("我主动的click()了");
  442. // players.play();
  443. // players.startPlaying();
  444. // var messageData = new Uint8Array(se)
  445. // player.decode(messageData);
  446. // }
  447. // document.addEventListener("WeixinJSBridgeReady", function() {
  448. // WeixinJSBridge.invoke('getNetworkType', {}, function(e) {
  449. // players.play();
  450. // players.startPlaying();
  451. // var messageData = new Uint8Array(se)
  452. // player.decode(messageData);
  453. // });
  454. // }, false);
  455. // window.AudioContext = window.AudioContext || window.webkitAudioContext;
  456. // console.log("window.AudioContext", window.AudioContext);
  457. // console.log("window.AudioContext.destination", window.AudioContext.destination);
  458. // if (window.AudioContext) {
  459. // window.audioContext = new window.AudioContext();
  460. // // Create empty buffer
  461. // var buffer = window.audioContext.createBuffer(1, 1, 22050);
  462. // var source = window.audioContext.createBufferSource();
  463. // source.buffer = buffer;
  464. // // Connect to output (speakers)
  465. // source.connect(window.audioContext.destination);
  466. // // Play sound
  467. // console.log("source.start", source, source.start, source.play, source.noteOn);
  468. // if (source.start) {
  469. // source.start(0);
  470. // } else if (source.play) {
  471. // source.play(0);
  472. // } else if (source.noteOn) {
  473. // source.noteOn(0);
  474. // }
  475. // }
  476. // var fixAudioContext = function(e) {
  477. // if (window.audioContext) {
  478. // // Create empty buffer
  479. // var buffer = window.audioContext.createBuffer(1, 1, 22050);
  480. // var source = window.audioContext.createBufferSource();
  481. // source.buffer = buffer;
  482. // // Connect to output (speakers)
  483. // source.connect(window.audioContext.destination);
  484. // // Play sound
  485. // console.log("source.start", source.start, source.play, source.noteOn);
  486. // if (source.start) {
  487. // source.start(0);
  488. // } else if (source.play) {
  489. // source.play(0);
  490. // } else if (source.noteOn) {
  491. // source.noteOn(0);
  492. // }
  493. // }
  494. // // Remove events
  495. // };
  496. var topwinHeight = window.screen.height - window.innerHeight + 30; //计算title top 头部
  497. $('#wine').css({
  498. "width": window.screen.width,
  499. "height": window.screen.height - topwinHeight - 20,
  500. "position": "absolute",
  501. })
  502. var winese = document.createElement("wine");
  503. wine.style.top = "-" + winese + 'px';
  504. var url = window.location.href;
  505. url = url.split('/')
  506. // var baseUrl = window.location.href; //"http://192.168.31.20"
  507. // var baseUrl = 'https://'+url[2] //url[2] //'http://192.168.31.159'//'http://' + url[2]
  508. var query = window.location.search.substring(1);
  509. // query = "clientType=1&cardIp=14.215.128.96&port=2012&sn=RK3930C2301900012&demoTime=3600&id=377&diskName=SC93mBww"
  510. var vars = query.split("&");
  511. console.log(vars)
  512. // var baseUrl = 'http://192.168.31.20'
  513. var baseUrl = 'test.androidscloud.com'
  514. var data = {}
  515. // 审核
  516. $.ajax({
  517. url: baseUrl + "/api/user/v1/config/download/isShow",
  518. data: {},
  519. type: 'get',
  520. dataType: 'json',
  521. success: function(data) {
  522. if (data.data) {
  523. $("#showsuss").show()
  524. } else {
  525. $("#showsuss").hide()
  526. }
  527. //
  528. }
  529. })
  530. var clientType = vars.find(e => {
  531. return e.startsWith('clientType')
  532. }) || ''
  533. // console.log(clientType)
  534. data.clientType = clientType.substring(11, clientType.length)
  535. // 小程序直接进入
  536. var diskName = vars.find(e => {
  537. return e.startsWith('diskName')
  538. }) || ''
  539. data.diskName = diskName.substring(9, diskName.length)
  540. // document.title = decodeURI(data.diskName)
  541. if (data.clientType == 1) {
  542. var cardIp = vars.find(e => {
  543. return e.startsWith('cardIp')
  544. }) || ''
  545. var port = vars.find(e => {
  546. return e.startsWith('port')
  547. }) || ''
  548. var sn = vars.find(e => {
  549. return e.startsWith('sn')
  550. }) || ''
  551. var demoTime = vars.find(e => {
  552. return e.startsWith('demoTime')
  553. }) || ''
  554. var id = vars.find(e => {
  555. return e.startsWith('id')
  556. }) || ''
  557. data.clientType = clientType.substring(11, clientType.length)
  558. data.cardIp = cardIp.substring(7, cardIp.length)
  559. data.port = port.substring(5, port.length)
  560. data.sn = sn.substring(3, sn.length)
  561. data.demoTime = demoTime.substring(9, demoTime.length)
  562. data.id = id.substring(3, id.length)
  563. } else if (data.clientType == 2) { //分享屏幕
  564. console.log("走到分享屏幕里面啦==========", data.clientTypes);
  565. $(".leftmains").css({
  566. "right": "-4rem"
  567. })
  568. $('.leftmains').hide()
  569. $('.bottommains').hide()
  570. $('#btnMuted').hide()
  571. let ip = vars.find(e => {
  572. return e.startsWith('ip')
  573. }) || ''
  574. var username = vars.find(e => {
  575. return e.startsWith('username')
  576. }) || ''
  577. var id = vars.find(e => {
  578. return e.startsWith('id')
  579. }) || ''
  580. var userCardId = vars.find(e => {
  581. return e.startsWith('userCardId')
  582. }) || ''
  583. data.id = id.substring(3, id.length)
  584. data.username = username.substring(9, username.length)
  585. data.ip = ip.substring(3, ip.length)
  586. data.userCardId = userCardId.substring(11, userCardId.length)
  587. // console.log(data.ip)
  588. // alert("测试3")
  589. // alert("data.userCardId",data.userCardId, "data.ip",data.ip)
  590. } else {
  591. // $(".leftmains").css({
  592. // "right":"-4rem"
  593. // })
  594. // $('.leftmains').hide()
  595. // $('.bottommains').hide()
  596. // $('#btnMuted').hide()
  597. var username = vars.find(e => {
  598. return e.startsWith('username')
  599. }) || ''
  600. var userCardId = vars.find(e => {
  601. return e.startsWith('userCardId')
  602. }) || ''
  603. data.username = username.substring(9, username.length)
  604. data.userCardId = userCardId.substring(11, userCardId.length)
  605. console.log(data.ip)
  606. }
  607. // 心跳
  608. // var time = 1000 * 30;
  609. // var interval;
  610. // fun()
  611. //
  612. // function run() {
  613. //
  614. // interval = setInterval(fun, time);
  615. // }
  616. //
  617. // function fun() {
  618. // $.ajax({
  619. // url: baseUrl + "/api/game/v1/cloudGame/dev/get/cardSn",
  620. // data: {
  621. // sn: data.sn
  622. // },
  623. // type: 'get',
  624. // dataType: 'json',
  625. // success: function(data) {
  626. //
  627. // }
  628. // })
  629. //
  630. // };
  631. // run();
  632. // data.clientType=1
  633. // data.sn="RK3930C2301900044"
  634. // data.cardIp="14.215.128.96"
  635. // data.port=2044
  636. var orientation = 0 //0 竖屏,1横屏
  637. var winHeight = window.screen.height - window.innerHeight
  638. // var urlss = url[2]
  639. // var urlss='192.168.31.20'
  640. // var urlss = "14.215.128.96"
  641. var urlss = 'test.androidscloud.com'
  642. document.body.addEventListener('touchmove', function(e) {
  643. e.preventDefault()
  644. }, {
  645. passive: false
  646. })
  647. //
  648. // urlss = "14.215.128.96"
  649. // console.log()
  650. // data.clientType = 1
  651. // data.sn="RK3930C2301900044"
  652. // data.cardIp="14.215.128.96"
  653. // data.port=2044
  654. if (data.clientType == 3) {
  655. var players = AV.Player.fromWebSocket("wss://" + urlss + '/authVideoWebSocket?' + "clientType=" + data.clientType +
  656. "&username=" + data.username + "&userCardId=" + data.userCardId);
  657. } else if (data.clientType == 2) {
  658. // var players = AV.Player.fromWebSocket("wss://" + urlss + '/shareWebSocket?' + "clientType=" + data.clientType +
  659. // "&username=" + data.username + "&userCardId=" + data.userCardId + "&ip=" + data.ip);
  660. var players = AV.Player.fromWebSocket(
  661. "wss://test.androidscloud.com/videoWebSocket?clientType=1&cardIp=14.215.128.96&port=2005&sn=RK3930C2301900005");
  662. } else {
  663. var players = AV.Player.fromWebSocket("wss://" + urlss + '/videoWebSocket?' + "clientType=" + data.clientType +
  664. "&cardIp=" + data.cardIp + "&port=" + data.port + "&sn=" + data.sn);
  665. }
  666. // // debugger
  667. // var players = AV.Player.fromWebSocket('ws://14.215.128.96/authVideoWebSocket?clientType=3&username=WqXTc1593762177&userCardId=377');
  668. players.play();
  669. players.volume = 100
  670. //var players = AV.Player.fromWebSocket('ws://14.215.128.96/videoWebSocket?clientType=0&cardIp=30.30.30.58&port=9100&sn=RK3930C2301900060');
  671. var warid = {
  672. id: data.id,
  673. type: 1,
  674. sn: data.sn
  675. }
  676. //结束时间 type=2
  677. var warids = {
  678. id: data.id,
  679. type: 2,
  680. sn: data.sn
  681. }
  682. // $.ajax({})
  683. // 关闭浏览器
  684. // window.onbeforeunload = function() {}
  685. //撤销的array
  686. var cancelList = new Array();
  687. //撤销的次数
  688. var cancelIndex = 0;
  689. var inputType = 0 //输入类型 0:手写,1:键盘输入
  690. //判断是否ie
  691. var IE_HACK = (/msie/i.test(navigator.userAgent) &&
  692. !/opera/i.test(navigator.userAgent));
  693. // 云手机相关逻辑
  694. var player = new Player({
  695. size: {
  696. width: 1280,
  697. height: 720
  698. }
  699. });
  700. var secanv = document.getElementById("wine");
  701. secanv.appendChild(player.canvas);
  702. console.log("player=========>>>>", player);
  703. console.log("secanv>>>>", secanv);
  704. // &cardIp="+data.data.extranetIp+"&port="+data.data.extranetPort+"&sn="+data.data.sn
  705. $(function() {
  706. initCanvas();
  707. });
  708. //初始化
  709. var initCanvas = function() {
  710. }
  711. window.onload = function() {};
  712. $("#voew").on("click", function() {})
  713. $("#box").on("click", function() {
  714. // draw_graph('pencil', this)
  715. })
  716. console.log(player)
  717. $('#mocan').on('click', function() {
  718. draw_graph('pencil', this)
  719. })
  720. // //初始化一下就可以了,
  721. let vConsole = new VConsole();
  722. // //你打印的数据 比如
  723. console.log('test');
  724. //就可像小程序一样的看了和调试了。
  725. $('.no-ne-an').on('click', function() {
  726. //结束时间 type=2
  727. let warids = {
  728. id: data.id,
  729. type: 2,
  730. sn: data.sn
  731. }
  732. $.ajax({
  733. url: baseUrl + "/api/game/v1/cloudGame/dev/getSn",
  734. data: warid,
  735. type: 'get',
  736. dataType: 'json',
  737. success: function(data) {
  738. history.go(-1)
  739. if (data.status == 0) {
  740. } else {
  741. alert(data.msg)
  742. }
  743. //
  744. }
  745. })
  746. })
  747. var btnMuted = document.querySelector("#btnMuted");
  748. btnMuted && (function() {
  749. var setHistory = function(left, top) {
  750. try {
  751. localStorage.setItem("muted-btn-loc", JSON.stringify({
  752. left: left,
  753. top: top
  754. }));
  755. } catch (ex) {}
  756. };
  757. var getHistory = function() {
  758. try {
  759. var value = localStorage.getItem("muted-btn-loc");
  760. if (!value) return null;
  761. value = JSON.parse(value);
  762. if (!value) return null;
  763. return value;
  764. } catch (ex) {
  765. return null
  766. }
  767. };
  768. var fixLoc = function(loc) {
  769. var rect = btnMuted.getBoundingClientRect();
  770. rect = {
  771. top: rect.top,
  772. left: rect.left,
  773. width: rect.width,
  774. height: rect.height
  775. }; //部分低版本浏览器,该属性为只读
  776. if (loc) {
  777. rect.left = loc.left;
  778. rect.top = loc.top;
  779. }
  780. var minX = 0;
  781. var minY = 0;
  782. var docRect = document.documentElement.getBoundingClientRect();
  783. var maxY = docRect.height - rect.height;
  784. var maxX = docRect.width - rect.width;
  785. var left = rect.left;
  786. var top = rect.top;
  787. left = Math.min(left, maxX);
  788. left = Math.max(left, minX);
  789. top = Math.min(top, maxY);
  790. top = Math.max(top, minY);
  791. console.log(rect.top, top, loc);
  792. if (loc || top !== rect.top || left !== rect.left) {
  793. btnMuted.style.cssText += "left:" + left + "px;top:" + top + "px;";
  794. }
  795. }
  796. window.addEventListener("resize", function() {
  797. fixLoc();
  798. });
  799. var touchPoint = {
  800. pageY: 0,
  801. pageX: 0
  802. };
  803. var currentLoc = {
  804. top: 0,
  805. left: 0,
  806. curTop: 0,
  807. curLeft: 0
  808. };
  809. var toMove = false;
  810. var touchmove = function(e) {
  811. e.preventDefault();
  812. var point = e.changedTouches[0];
  813. var top = -touchPoint.pageY + point.pageY;
  814. var left = -touchPoint.pageX + point.pageX;
  815. if (toMove) {
  816. top += currentLoc.top;
  817. left += currentLoc.left;
  818. currentLoc.curLeft = left;
  819. currentLoc.curTop = top;
  820. btnMuted.style.cssText += "left:" + left + "px;top:" + top + "px;";
  821. } else {
  822. if (Math.abs(top) >= 5 || Math.abs(left) >= 5) {
  823. toMove = true;
  824. }
  825. }
  826. };
  827. var touchend = function() {
  828. window.removeEventListener("touchmove", touchmove, {
  829. passive: false
  830. });
  831. window.removeEventListener("touchend", touchend, {
  832. passive: false
  833. });
  834. if (toMove) {
  835. setHistory(currentLoc.curLeft, currentLoc.curTop);
  836. fixLoc();
  837. } else {
  838. //按点击处理
  839. var set = $('.control-right-img').attr("data-id")
  840. if (set == '1') {
  841. $('.control-right-img').attr({
  842. "data-id": "2"
  843. })
  844. // $('.control-right-img').find('img').attr({
  845. // "src": "../static/img/musicturn.png"
  846. // })
  847. players.volume = 100
  848. $(".leftmains").css({
  849. "right": "-4rem"
  850. })
  851. // console.log(players)
  852. // players.play();
  853. } else {
  854. $('.control-right-img').attr({
  855. "data-id": "1"
  856. })
  857. $(".leftmains").css({
  858. "right": "0rem"
  859. })
  860. // $('.control-right-img').find('img').attr({
  861. // "src": "../static/img/musicfalse.png"
  862. // })
  863. players.volume = 0
  864. // players.off('pause');
  865. // players.pause();
  866. // var embed = document.embedPlay;
  867. console.log(players, "fdsfdsf")
  868. }
  869. }
  870. }
  871. btnMuted.addEventListener("touchstart", function(e) {
  872. e.preventDefault();
  873. toMove = false;
  874. var point = e.changedTouches[0];
  875. touchPoint.pageX = point.pageX;
  876. touchPoint.pageY = point.pageY;
  877. var rect = e.target.getBoundingClientRect();
  878. currentLoc.top = rect.top;
  879. currentLoc.left = rect.left;
  880. window.addEventListener("touchmove", touchmove, {
  881. passive: false
  882. });
  883. window.addEventListener("touchend", touchend, {
  884. passive: false
  885. });
  886. }, {
  887. passive: false
  888. });
  889. var history = getHistory();
  890. if (history) {
  891. fixLoc(history);
  892. }
  893. btnMuted.classList.remove("hide");
  894. })();
  895. $(".boximg").on("click", function() {
  896. $(".mainbox").css({
  897. "display": "none"
  898. })
  899. })
  900. // 剪切板
  901. $(".sboxbu").on("click", function() {
  902. $(".sbox").css({
  903. "display": "none"
  904. })
  905. })
  906. // 剪切板
  907. $(".uploadss").on("click", function() {
  908. $(".sbox").css({
  909. "display": "none"
  910. })
  911. })
  912. $("#upload").on("click", function() {
  913. wx.miniProgram.switchTab({
  914. url: '/pages/home/home'
  915. })
  916. })
  917. function selectText(x) {
  918. if (document.selection) {
  919. var range = document.body.createTextRange();
  920. range.moveToElementText(x);
  921. range.select();
  922. } else if (window.getSelection) {
  923. var selection = window.getSelection();
  924. var range = document.createRange();
  925. selection.removeAllRanges();
  926. range.selectNodeContents(x);
  927. selection.addRange(range);
  928. }
  929. }
  930. function cp(x) {
  931. $(".mainbox").css({
  932. "display": "none"
  933. })
  934. $(".sbox").css({
  935. "display": "block"
  936. })
  937. selectText(x);
  938. document.execCommand("copy");
  939. }
  940. </script>
  941. </body>
  942. </html>