heyang 4 gadi atpakaļ
vecāks
revīzija
f1ea4dc576

+ 3 - 2
screenAndroid/WXdraw.js

@@ -98,8 +98,9 @@ function doConnect() {
 		// });
 	};
 }
-$('#box').on("click", function () {
-	draw_graph('pencil', this)
+
+$('body').on("click", function () {
+	draw_graph('pencil');
 })
 //剪切板
 $(".upload").on("click", function () {

+ 0 - 36
screenAndroid/WXtrialInterface.html

@@ -116,7 +116,6 @@
 	<div id="copy-txt" style="position: absolute;opacity: 0;">
 		<span id="user_ref_id">www.androidsCloud.com</span>
 	</div>
-
 	<script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.3.2.js"></script>
 	<script type="text/javascript" src="../static/js/jquery-1.11.0.min.js"></script>
 	<script type="text/javascript" src="helper.js"></script>
@@ -139,12 +138,6 @@
 				$('.loading').hide();
 			}
 		});
-		// document.addEventListener('touchstart', function () {
-		// 	var video = document.getElementById("playerVideo");
-		// 	var audio = document.getElementById("audioPlayer");
-		// 	video.play();
-		// 	audio.play();
-		// }, false);
 		var topwinHeight = window.screen.height - window.innerHeight + 30; //计算title top 头部
 		$('#wine').css({
 			"width": window.screen.width,
@@ -191,32 +184,6 @@
 			curTime = new Date().getTime();
 
 			var myPlay = document.getElementById("wine");
-			// myPlay.onmousedown = function (event) {
-			// 	if (event.button == 0) {
-			// 		var posX = event.offsetX * 720 * 1.0 / myVideo.clientWidth;
-			// 		var posY = event.offsetY * 1280 * 1.0 / myVideo.clientHeight;
-			// 		var buffer = ExexuteMouseDown(posX.toString(), posY.toString());
-			// 		ws.send(buffer);
-			// 		isDrag = true;
-			// 	}
-			// }
-
-			// myPlay.onmousemove = function (event) {
-			// 	if (isDrag && event.button == 0) {
-			// 		var posX = event.offsetX * 720 * 1.0 / myVideo.clientWidth;
-			// 		var posY = event.offsetY * 1280 * 1.0 / myVideo.clientHeight;
-			// 		var buffer = ExexuteMouseMove(posX.toString(), posY.toString());
-			// 		ws.send(buffer);
-			// 	}
-			// }
-
-			// myPlay.onmouseup = function (event) {
-			// 	isDrag = false;
-			// 	var posX = event.offsetX * 720 * 1.0 / myVideo.clientWidth;
-			// 	var posY = event.offsetY * 1280 * 1.0 / myVideo.clientHeight;
-			// 	var buffer = ExexuteMouseUp(posX.toString(), posY.toString());
-			// 	ws.send(buffer);
-			// }
 
 			myPlay.onkeydown = function (event) {
 				ExexuteKeyDown(e.keyCode);
@@ -293,9 +260,6 @@
 				if (data.video != null) { //喂视频
 					if (isFeed) {
 						jmuxer.feed(data);
-						// $('.weui-mask_transparent').hide()
-						// $('.weui-toast').hide()
-						// $('.loading').hide()
 					}
 				}
 			});

+ 1 - 25
screenIos/WXdraw.js

@@ -53,37 +53,13 @@ function doConnect() {
 	wsss.onclose = function () {
 		wsss.close();
 		doConnect();
-		// $.confirm({
-		// 	title: '提示',
-		// 	text: '连接断开,是否准备重连?',
-		// 	onOK: function () {
-		// 		doConnect();
-		// 	},
-		// 	onCancel: function () {
-		// 		wx.miniProgram.switchTab({
-		// 			url: '/pages/home/home'
-		// 		})
-		// 	}
-		// });
 	};
 	wsss.onerror = function () {
 		wsss.close();
 		doConnect();
-		// $.confirm({
-		// 	title: '提示',
-		// 	text: '连接断开,是否准备重连?',
-		// 	onOK: function () {
-		// 		doConnect();
-		// 	},
-		// 	onCancel: function () {
-		// 		wx.miniProgram.switchTab({
-		// 			url: '/pages/home/home'
-		// 		})
-		// 	}
-		// });
 	};
 }
-$('#box').on("click", function () {
+$('body').on("click", function () {
 	draw_graph('pencil', this)
 })
 //剪切板

+ 17 - 18
screenIos/WXtrialInterface.html

@@ -123,6 +123,7 @@
 
 	<script>
 		var topwinHeight = window.screen.height - window.innerHeight + 30; //计算title top 头部
+		var renderCount = 0
 		$('#wine').css({
 			"width": window.screen.width,
 			"height": window.screen.height - topwinHeight - 20,
@@ -134,12 +135,19 @@
 		});
 		var winese = document.createElement("wine");
 		wine.style.top = "-" + winese + 'px';
-
+		var isAudioPlay = false;
+		$.alert({
+			title: '提示',
+			text: '开始使用云手机',
+			onOK: function () {
+				isAudioPlay = true;
+			}
+		});
 		var url = window.location.href;
 		url = url.split('/');
 		var baseUrl = "http://192.168.199.243";
-		var form = {}
-		//			 审核
+		var form = {};
+		// 审核
 		$.ajax({
 			url: baseUrl + "/api/user/v1/config/download/isShow",
 			data: {},
@@ -180,10 +188,10 @@
 			form.userCardId = parameters['userCardId'];
 		}
 
-		var orientation = 0 //0 竖屏,1横屏
+		var orientation = 0; //0 竖屏,1横屏
 
 		document.body.addEventListener('touchmove', function (e) {
-			e.preventDefault()
+			e.preventDefault();
 		}, {
 			passive: false
 		})
@@ -425,6 +433,9 @@
 				case 0:
 					break;
 				case 1:
+					if (renderCount++ < 3 || !isAudioPlay) {
+						return
+					}
 					webglPlayer.renderFrame(objData.data, 720, 1280, 720 * 1280, (720 / 2) * (1280 / 2));
 					$('.weui-mask_transparent').hide()
 					$('.weui-toast').hide()
@@ -455,7 +466,7 @@
 
 		webSocketWorker.onmessage = function (event) {
 			var input = event.data;
-			if (input[0] == 0xff) {
+			if (input[0] == 0xff && isAudioPlay && renderCount >= 3) {
 				decodeAAC(input);
 			}
 			if (input[0] == 0 && input[1] == 0 && input[2] == 0 && input[3] == 1) {
@@ -463,18 +474,6 @@
 			}
 			if (event.data === 'close') {
 				webSocketWorker.postMessage('restart');
-				// $.confirm({
-				// 	title: '提示',
-				// 	text: '连接断开,是否准备重连?',
-				// 	onOK: function () {
-				// 		webSocketWorker.postMessage('restart');
-				// 	},
-				// 	onCancel: function () {
-				// 		wx.miniProgram.switchTab({
-				// 			url: '/pages/home/home'
-				// 		})
-				// 	}
-				// });
 			}
 		}