WXtrialInterface.html 27 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076
  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="https://lf1-cdn-tos.bytegoofy.com/goofy/developer/jssdk/jssdk-1.0.3.js"></script>
  415. <script src="../static/js/jquery-1.11.0.min.js"></script>
  416. <!-- 音频-->
  417. <script src="../static/js/classlist.js"></script>
  418. <script src="../static/js/players.js"></script>
  419. <script src="../static/js/auroraplayer.js"></script>
  420. <script src="../static/js/aurora.js"></script>
  421. <script src="../static/js/aac.js"></script>
  422. <script src="../static/js/web.js?id=101"></script>
  423. <!-- <script src="../static/js/webapk.js"></script> -->
  424. <!-- 视频-->
  425. <script type="text/javascript" src="../static/js/Decoder.js"></script>
  426. <script type="text/javascript" src="../static/js/YUVCanvas.js"></script>
  427. <script type="text/javascript" src="../static/js/Player.js"></script>
  428. <script src="https://cdn.bootcss.com/vConsole/3.2.0/vconsole.min.js"></script>
  429. <script src="../static/distss/WXdraw.js?id=105"></script>
  430. <script>
  431. // document.addEventListener('touchstart', function() {
  432. // console.log("我主动的play()了");
  433. // players.play();
  434. // players.startPlaying();
  435. // var messageData = new Uint8Array(se)
  436. // player.decode(messageData);
  437. // // return this.asset.start(false);
  438. // this.playing = true;
  439. // });
  440. // window.addEventListener('click', playAudio, false);
  441. // function playAudio(obj) {
  442. // console.log("我主动的click()了");
  443. // players.play();
  444. // players.startPlaying();
  445. // var messageData = new Uint8Array(se)
  446. // player.decode(messageData);
  447. // }
  448. // document.addEventListener("WeixinJSBridgeReady", function() {
  449. // WeixinJSBridge.invoke('getNetworkType', {}, function(e) {
  450. // players.play();
  451. // players.startPlaying();
  452. // var messageData = new Uint8Array(se)
  453. // player.decode(messageData);
  454. // });
  455. // }, false);
  456. // window.AudioContext = window.AudioContext || window.webkitAudioContext;
  457. // console.log("window.AudioContext", window.AudioContext);
  458. // console.log("window.AudioContext.destination", window.AudioContext.destination);
  459. // if (window.AudioContext) {
  460. // window.audioContext = new window.AudioContext();
  461. // // Create empty buffer
  462. // var buffer = window.audioContext.createBuffer(1, 1, 22050);
  463. // var source = window.audioContext.createBufferSource();
  464. // source.buffer = buffer;
  465. // // Connect to output (speakers)
  466. // source.connect(window.audioContext.destination);
  467. // // Play sound
  468. // console.log("source.start", source, source.start, source.play, source.noteOn);
  469. // if (source.start) {
  470. // source.start(0);
  471. // } else if (source.play) {
  472. // source.play(0);
  473. // } else if (source.noteOn) {
  474. // source.noteOn(0);
  475. // }
  476. // }
  477. // var fixAudioContext = function(e) {
  478. // if (window.audioContext) {
  479. // // Create empty buffer
  480. // var buffer = window.audioContext.createBuffer(1, 1, 22050);
  481. // var source = window.audioContext.createBufferSource();
  482. // source.buffer = buffer;
  483. // // Connect to output (speakers)
  484. // source.connect(window.audioContext.destination);
  485. // // Play sound
  486. // console.log("source.start", source.start, source.play, source.noteOn);
  487. // if (source.start) {
  488. // source.start(0);
  489. // } else if (source.play) {
  490. // source.play(0);
  491. // } else if (source.noteOn) {
  492. // source.noteOn(0);
  493. // }
  494. // }
  495. // // Remove events
  496. // };
  497. var topwinHeight = window.screen.height - window.innerHeight + 30; //计算title top 头部
  498. $('#wine').css({
  499. "width": window.screen.width,
  500. "height": window.screen.height - topwinHeight - 20,
  501. "position": "absolute",
  502. })
  503. var winese = document.createElement("wine");
  504. wine.style.top = "-" + winese + 'px';
  505. var url = window.location.href;
  506. url = url.split('/')
  507. // var baseUrl = window.location.href; //"http://192.168.31.20"
  508. // var baseUrl = 'https://'+url[2] //url[2] //'http://192.168.31.159'//'http://' + url[2]
  509. var query = window.location.search.substring(1);
  510. // query = "clientType=1&cardIp=14.215.128.96&port=2012&sn=RK3930C2301900012&demoTime=3600&id=377&diskName=SC93mBww"
  511. var vars = query.split("&");
  512. console.log(vars)
  513. // var baseUrl = 'http://192.168.31.20'
  514. var baseUrl = 'test.androidscloud.com'
  515. var data = {}
  516. // 审核
  517. $.ajax({
  518. url: baseUrl + "/api/user/v1/config/download/isShow",
  519. data: {},
  520. type: 'get',
  521. dataType: 'json',
  522. success: function(data) {
  523. if (data.data) {
  524. $("#showsuss").show()
  525. } else {
  526. $("#showsuss").hide()
  527. }
  528. //
  529. }
  530. })
  531. var clientType = vars.find(e => {
  532. return e.startsWith('clientType')
  533. }) || ''
  534. // console.log(clientType)
  535. data.clientType = clientType.substring(11, clientType.length)
  536. // 小程序直接进入
  537. var diskName = vars.find(e => {
  538. return e.startsWith('diskName')
  539. }) || ''
  540. data.diskName = diskName.substring(9, diskName.length)
  541. // document.title = decodeURI(data.diskName)
  542. if (data.clientType == 1) {
  543. var cardIp = vars.find(e => {
  544. return e.startsWith('cardIp')
  545. }) || ''
  546. var port = vars.find(e => {
  547. return e.startsWith('port')
  548. }) || ''
  549. var sn = vars.find(e => {
  550. return e.startsWith('sn')
  551. }) || ''
  552. var demoTime = vars.find(e => {
  553. return e.startsWith('demoTime')
  554. }) || ''
  555. var id = vars.find(e => {
  556. return e.startsWith('id')
  557. }) || ''
  558. data.clientType = clientType.substring(11, clientType.length)
  559. data.cardIp = cardIp.substring(7, cardIp.length)
  560. data.port = port.substring(5, port.length)
  561. data.sn = sn.substring(3, sn.length)
  562. data.demoTime = demoTime.substring(9, demoTime.length)
  563. data.id = id.substring(3, id.length)
  564. } else if (data.clientType == 2) { //分享屏幕
  565. console.log("走到分享屏幕里面啦==========", data.clientTypes);
  566. $(".leftmains").css({
  567. "right": "-4rem"
  568. })
  569. $('.leftmains').hide()
  570. $('.bottommains').hide()
  571. $('#btnMuted').hide()
  572. let ip = vars.find(e => {
  573. return e.startsWith('ip')
  574. }) || ''
  575. var username = vars.find(e => {
  576. return e.startsWith('username')
  577. }) || ''
  578. var id = vars.find(e => {
  579. return e.startsWith('id')
  580. }) || ''
  581. var userCardId = vars.find(e => {
  582. return e.startsWith('userCardId')
  583. }) || ''
  584. data.id = id.substring(3, id.length)
  585. data.username = username.substring(9, username.length)
  586. data.ip = ip.substring(3, ip.length)
  587. data.userCardId = userCardId.substring(11, userCardId.length)
  588. // console.log(data.ip)
  589. // alert("测试3")
  590. // alert("data.userCardId",data.userCardId, "data.ip",data.ip)
  591. } else {
  592. // $(".leftmains").css({
  593. // "right":"-4rem"
  594. // })
  595. // $('.leftmains').hide()
  596. // $('.bottommains').hide()
  597. // $('#btnMuted').hide()
  598. var username = vars.find(e => {
  599. return e.startsWith('username')
  600. }) || ''
  601. var userCardId = vars.find(e => {
  602. return e.startsWith('userCardId')
  603. }) || ''
  604. data.username = username.substring(9, username.length)
  605. data.userCardId = userCardId.substring(11, userCardId.length)
  606. console.log(data.ip)
  607. }
  608. // 心跳
  609. // var time = 1000 * 30;
  610. // var interval;
  611. // fun()
  612. //
  613. // function run() {
  614. //
  615. // interval = setInterval(fun, time);
  616. // }
  617. //
  618. // function fun() {
  619. // $.ajax({
  620. // url: baseUrl + "/api/game/v1/cloudGame/dev/get/cardSn",
  621. // data: {
  622. // sn: data.sn
  623. // },
  624. // type: 'get',
  625. // dataType: 'json',
  626. // success: function(data) {
  627. //
  628. // }
  629. // })
  630. //
  631. // };
  632. // run();
  633. // data.clientType=1
  634. // data.sn="RK3930C2301900044"
  635. // data.cardIp="14.215.128.96"
  636. // data.port=2044
  637. var orientation = 0 //0 竖屏,1横屏
  638. var winHeight = window.screen.height - window.innerHeight
  639. // var urlss = url[2]
  640. // var urlss='192.168.31.20'
  641. // var urlss = "14.215.128.96"
  642. var urlss = 'test.androidscloud.com'
  643. document.body.addEventListener('touchmove', function(e) {
  644. e.preventDefault()
  645. }, {
  646. passive: false
  647. })
  648. //
  649. // urlss = "14.215.128.96"
  650. // console.log()
  651. // data.clientType = 1
  652. // data.sn="RK3930C2301900044"
  653. // data.cardIp="14.215.128.96"
  654. // data.port=2044
  655. if (data.clientType == 3) {
  656. var players = AV.Player.fromWebSocket("wss://" + urlss + '/authVideoWebSocket?' + "clientType=" + data.clientType +
  657. "&username=" + data.username + "&userCardId=" + data.userCardId);
  658. } else if (data.clientType == 2) {
  659. // var players = AV.Player.fromWebSocket("wss://" + urlss + '/shareWebSocket?' + "clientType=" + data.clientType +
  660. // "&username=" + data.username + "&userCardId=" + data.userCardId + "&ip=" + data.ip);
  661. var players = AV.Player.fromWebSocket(
  662. "wss://test.androidscloud.com/videoWebSocket?clientType=1&cardIp=14.215.128.96&port=2005&sn=RK3930C2301900005");
  663. } else {
  664. var players = AV.Player.fromWebSocket("wss://" + urlss + '/videoWebSocket?' + "clientType=" + data.clientType +
  665. "&cardIp=" + data.cardIp + "&port=" + data.port + "&sn=" + data.sn);
  666. }
  667. // // debugger
  668. // var players = AV.Player.fromWebSocket('ws://14.215.128.96/authVideoWebSocket?clientType=3&username=WqXTc1593762177&userCardId=377');
  669. players.play();
  670. players.volume = 100
  671. //var players = AV.Player.fromWebSocket('ws://14.215.128.96/videoWebSocket?clientType=0&cardIp=30.30.30.58&port=9100&sn=RK3930C2301900060');
  672. var warid = {
  673. id: data.id,
  674. type: 1,
  675. sn: data.sn
  676. }
  677. //结束时间 type=2
  678. var warids = {
  679. id: data.id,
  680. type: 2,
  681. sn: data.sn
  682. }
  683. // $.ajax({})
  684. // 关闭浏览器
  685. // window.onbeforeunload = function() {}
  686. //撤销的array
  687. var cancelList = new Array();
  688. //撤销的次数
  689. var cancelIndex = 0;
  690. var inputType = 0 //输入类型 0:手写,1:键盘输入
  691. //判断是否ie
  692. var IE_HACK = (/msie/i.test(navigator.userAgent) &&
  693. !/opera/i.test(navigator.userAgent));
  694. // 云手机相关逻辑
  695. var player = new Player({
  696. size: {
  697. width: 1280,
  698. height: 720
  699. }
  700. });
  701. var secanv = document.getElementById("wine");
  702. secanv.appendChild(player.canvas);
  703. console.log("player=========>>>>", player);
  704. console.log("secanv>>>>", secanv);
  705. // &cardIp="+data.data.extranetIp+"&port="+data.data.extranetPort+"&sn="+data.data.sn
  706. $(function() {
  707. initCanvas();
  708. });
  709. //初始化
  710. var initCanvas = function() {
  711. }
  712. window.onload = function() {};
  713. $("#voew").on("click", function() {})
  714. $("#box").on("click", function() {
  715. // draw_graph('pencil', this)
  716. })
  717. console.log(player)
  718. $('#mocan').on('click', function() {
  719. draw_graph('pencil', this)
  720. })
  721. // //初始化一下就可以了,
  722. let vConsole = new VConsole();
  723. // //你打印的数据 比如
  724. console.log('test');
  725. //就可像小程序一样的看了和调试了。
  726. $('.no-ne-an').on('click', function() {
  727. //结束时间 type=2
  728. let warids = {
  729. id: data.id,
  730. type: 2,
  731. sn: data.sn
  732. }
  733. $.ajax({
  734. url: baseUrl + "/api/game/v1/cloudGame/dev/getSn",
  735. data: warid,
  736. type: 'get',
  737. dataType: 'json',
  738. success: function(data) {
  739. history.go(-1)
  740. if (data.status == 0) {
  741. } else {
  742. alert(data.msg)
  743. }
  744. //
  745. }
  746. })
  747. })
  748. var btnMuted = document.querySelector("#btnMuted");
  749. btnMuted && (function() {
  750. var setHistory = function(left, top) {
  751. try {
  752. localStorage.setItem("muted-btn-loc", JSON.stringify({
  753. left: left,
  754. top: top
  755. }));
  756. } catch (ex) {}
  757. };
  758. var getHistory = function() {
  759. try {
  760. var value = localStorage.getItem("muted-btn-loc");
  761. if (!value) return null;
  762. value = JSON.parse(value);
  763. if (!value) return null;
  764. return value;
  765. } catch (ex) {
  766. return null
  767. }
  768. };
  769. var fixLoc = function(loc) {
  770. var rect = btnMuted.getBoundingClientRect();
  771. rect = {
  772. top: rect.top,
  773. left: rect.left,
  774. width: rect.width,
  775. height: rect.height
  776. }; //部分低版本浏览器,该属性为只读
  777. if (loc) {
  778. rect.left = loc.left;
  779. rect.top = loc.top;
  780. }
  781. var minX = 0;
  782. var minY = 0;
  783. var docRect = document.documentElement.getBoundingClientRect();
  784. var maxY = docRect.height - rect.height;
  785. var maxX = docRect.width - rect.width;
  786. var left = rect.left;
  787. var top = rect.top;
  788. left = Math.min(left, maxX);
  789. left = Math.max(left, minX);
  790. top = Math.min(top, maxY);
  791. top = Math.max(top, minY);
  792. console.log(rect.top, top, loc);
  793. if (loc || top !== rect.top || left !== rect.left) {
  794. btnMuted.style.cssText += "left:" + left + "px;top:" + top + "px;";
  795. }
  796. }
  797. window.addEventListener("resize", function() {
  798. fixLoc();
  799. });
  800. var touchPoint = {
  801. pageY: 0,
  802. pageX: 0
  803. };
  804. var currentLoc = {
  805. top: 0,
  806. left: 0,
  807. curTop: 0,
  808. curLeft: 0
  809. };
  810. var toMove = false;
  811. var touchmove = function(e) {
  812. e.preventDefault();
  813. var point = e.changedTouches[0];
  814. var top = -touchPoint.pageY + point.pageY;
  815. var left = -touchPoint.pageX + point.pageX;
  816. if (toMove) {
  817. top += currentLoc.top;
  818. left += currentLoc.left;
  819. currentLoc.curLeft = left;
  820. currentLoc.curTop = top;
  821. btnMuted.style.cssText += "left:" + left + "px;top:" + top + "px;";
  822. } else {
  823. if (Math.abs(top) >= 5 || Math.abs(left) >= 5) {
  824. toMove = true;
  825. }
  826. }
  827. };
  828. var touchend = function() {
  829. window.removeEventListener("touchmove", touchmove, {
  830. passive: false
  831. });
  832. window.removeEventListener("touchend", touchend, {
  833. passive: false
  834. });
  835. if (toMove) {
  836. setHistory(currentLoc.curLeft, currentLoc.curTop);
  837. fixLoc();
  838. } else {
  839. //按点击处理
  840. var set = $('.control-right-img').attr("data-id")
  841. if (set == '1') {
  842. $('.control-right-img').attr({
  843. "data-id": "2"
  844. })
  845. // $('.control-right-img').find('img').attr({
  846. // "src": "../static/img/musicturn.png"
  847. // })
  848. players.volume = 100
  849. $(".leftmains").css({
  850. "right": "-4rem"
  851. })
  852. // console.log(players)
  853. // players.play();
  854. } else {
  855. $('.control-right-img').attr({
  856. "data-id": "1"
  857. })
  858. $(".leftmains").css({
  859. "right": "0rem"
  860. })
  861. // $('.control-right-img').find('img').attr({
  862. // "src": "../static/img/musicfalse.png"
  863. // })
  864. players.volume = 0
  865. // players.off('pause');
  866. // players.pause();
  867. // var embed = document.embedPlay;
  868. console.log(players, "fdsfdsf")
  869. }
  870. }
  871. }
  872. btnMuted.addEventListener("touchstart", function(e) {
  873. e.preventDefault();
  874. toMove = false;
  875. var point = e.changedTouches[0];
  876. touchPoint.pageX = point.pageX;
  877. touchPoint.pageY = point.pageY;
  878. var rect = e.target.getBoundingClientRect();
  879. currentLoc.top = rect.top;
  880. currentLoc.left = rect.left;
  881. window.addEventListener("touchmove", touchmove, {
  882. passive: false
  883. });
  884. window.addEventListener("touchend", touchend, {
  885. passive: false
  886. });
  887. }, {
  888. passive: false
  889. });
  890. var history = getHistory();
  891. if (history) {
  892. fixLoc(history);
  893. }
  894. btnMuted.classList.remove("hide");
  895. })();
  896. $(".boximg").on("click", function() {
  897. $(".mainbox").css({
  898. "display": "none"
  899. })
  900. })
  901. // 剪切板
  902. $(".sboxbu").on("click", function() {
  903. $(".sbox").css({
  904. "display": "none"
  905. })
  906. })
  907. // 剪切板
  908. $(".uploadss").on("click", function() {
  909. $(".sbox").css({
  910. "display": "none"
  911. })
  912. })
  913. $("#upload").on("click", function() {
  914. if(navigator.userAgent.toLowerCase().includes('toutiaomicroapp')){
  915. tt.miniProgram.switchTab({
  916. url: '/pages/home/home'
  917. })
  918. }else{
  919. wx.miniProgram.switchTab({
  920. url: '/pages/home/home'
  921. })
  922. }
  923. })
  924. function selectText(x) {
  925. if (document.selection) {
  926. var range = document.body.createTextRange();
  927. range.moveToElementText(x);
  928. range.select();
  929. } else if (window.getSelection) {
  930. var selection = window.getSelection();
  931. var range = document.createRange();
  932. selection.removeAllRanges();
  933. range.selectNodeContents(x);
  934. selection.addRange(range);
  935. }
  936. }
  937. function cp(x) {
  938. $(".mainbox").css({
  939. "display": "none"
  940. })
  941. $(".sbox").css({
  942. "display": "block"
  943. })
  944. selectText(x);
  945. document.execCommand("copy");
  946. }
  947. </script>
  948. </body>
  949. </html>