|
@@ -33,7 +33,9 @@ form.domainName = parameters["domainName"];
|
|
|
var isWSS = true;
|
|
|
var cUrl = isWSS ? "wss://" + form.domainName + "?cardIp=" + form.ip : "ws://" + form.domainName + "?cardIp=" + form.ip;
|
|
|
// var cUrl = "ws://192.168.199.46:9101?token=test0123456789";
|
|
|
-
|
|
|
+var deviceBoard = parameters['deviceBoard'];
|
|
|
+var videoWidth = deviceBoard.substring(0, 2) === 'MTK' ? 1080 : 720
|
|
|
+var videoHeight = deviceBoard.substring(0, 2) === 'MTK' ? 1920 : 1280
|
|
|
var wsss,errorTime = 0;
|
|
|
doConnect();
|
|
|
function throttle(fn, delay) {
|
|
@@ -148,8 +150,8 @@ var draw_graph = function (graphType, obj) {
|
|
|
if (resolving == 0) {
|
|
|
var ping;
|
|
|
for (var i = 0; i < touchfor.length; i++) {
|
|
|
- var cawidthXs = touchfor[i].pageY * (1280 / voheight)
|
|
|
- var caheightYs = 720 - touchfor[i].pageX * (720 / vowidth)
|
|
|
+ var cawidthXs = touchfor[i].pageY * (videoHeight / voheight)
|
|
|
+ var caheightYs = videoWidth - touchfor[i].pageX * (videoWidth / vowidth)
|
|
|
ping = {
|
|
|
"data": {
|
|
|
"action": 0,
|
|
@@ -165,8 +167,8 @@ var draw_graph = function (graphType, obj) {
|
|
|
} else {
|
|
|
var ping;
|
|
|
for (var i = 0; i < touchfor.length; i++) {
|
|
|
- var cawidthXs = touchfor[i].pageX * (720 / vowidth)
|
|
|
- var caheightYs = touchfor[i].pageY * (1280 / voheight)
|
|
|
+ var cawidthXs = touchfor[i].pageX * (videoWidth / vowidth)
|
|
|
+ var caheightYs = touchfor[i].pageY * (videoHeight / voheight)
|
|
|
ping = {
|
|
|
"data": {
|
|
|
"action": 0,
|
|
@@ -191,8 +193,8 @@ var draw_graph = function (graphType, obj) {
|
|
|
if (resolving == 0) {
|
|
|
var ping;
|
|
|
for (var i = 0; i < touchfor.length; i++) {
|
|
|
- var cawidthXs = touchfor[i].pageY * (1280 / voheight);
|
|
|
- var caheightYs = 720 - touchfor[i].pageX * (720 / vowidth);
|
|
|
+ var cawidthXs = touchfor[i].pageY * (videoHeight / voheight);
|
|
|
+ var caheightYs = videoWidth - touchfor[i].pageX * (videoWidth / vowidth);
|
|
|
ping = {
|
|
|
"data": {
|
|
|
"action": 1,
|
|
@@ -208,8 +210,8 @@ var draw_graph = function (graphType, obj) {
|
|
|
} else {
|
|
|
var ping;
|
|
|
for (var i = 0; i < touchfor.length; i++) {
|
|
|
- var cawidthXs = touchfor[i].pageX * (720 / vowidth);
|
|
|
- var caheightYs = touchfor[i].pageY * (1280 / voheight);
|
|
|
+ var cawidthXs = touchfor[i].pageX * (videoWidth / vowidth);
|
|
|
+ var caheightYs = touchfor[i].pageY * (videoHeight / voheight);
|
|
|
ping = {
|
|
|
"data": {
|
|
|
"action": 1,
|
|
@@ -239,8 +241,8 @@ var draw_graph = function (graphType, obj) {
|
|
|
//是否横屏 morePortionMove
|
|
|
if (resolving == 0) {
|
|
|
for (var i = 0; i < touchfor.length; i++) {
|
|
|
- var cawidthXs = touchfor[i].pageY * (1280 / voheight)
|
|
|
- var caheightYs = 720 - touchfor[i].pageX * (720 / vowidth)
|
|
|
+ var cawidthXs = touchfor[i].pageY * (videoHeight / voheight)
|
|
|
+ var caheightYs = videoWidth - touchfor[i].pageX * (videoWidth / vowidth)
|
|
|
ping = {
|
|
|
"data": {
|
|
|
"action": 2,
|
|
@@ -257,8 +259,8 @@ var draw_graph = function (graphType, obj) {
|
|
|
} else {
|
|
|
var ping;
|
|
|
for (var i = 0; i < touchfor.length; i++) {
|
|
|
- var cawidthXs = touchfor[i].pageX * (720 / vowidth);
|
|
|
- var caheightYs = touchfor[i].pageY * (1280 / voheight);
|
|
|
+ var cawidthXs = touchfor[i].pageX * (videoWidth / vowidth);
|
|
|
+ var caheightYs = touchfor[i].pageY * (videoHeight / voheight);
|
|
|
ping = {
|
|
|
"data": {
|
|
|
"action": 2,
|