|
|
@@ -233,11 +233,13 @@ var draw_graph = function (graphType, obj) {
|
|
|
var touchfor = e.originalEvent.changedTouches; //for 的手指数组
|
|
|
//是否横屏
|
|
|
for (var i = 0; i < touchfor.length; i++) {
|
|
|
- var acrossWidthX = touchfor[i].pageY * (videoHeight / voheight);
|
|
|
- var acrossHeightY =
|
|
|
- videoWidth - touchfor[i].pageX * (videoWidth / vowidth);
|
|
|
- var verticalWidthX = touchfor[i].pageX * (videoWidth / vowidth);
|
|
|
- var verticalHeightY = touchfor[i].pageY * (videoHeight / voheight);
|
|
|
+ // var acrossWidthX = touchfor[i].pageY * (videoHeight / voheight);
|
|
|
+ // var acrossHeightY =
|
|
|
+ // videoWidth - touchfor[i].pageX * (videoWidth / vowidth);
|
|
|
+ var verticalWidthX =
|
|
|
+ touchfor[i].pageX * (window.currentPhoneSize.width / vowidth);
|
|
|
+ var verticalHeightY =
|
|
|
+ touchfor[i].pageY * (window.currentPhoneSize.width / voheight);
|
|
|
var idx = ongoingTouches.findIndex(function (ele) {
|
|
|
return ele.identifier === touchfor[i].identifier;
|
|
|
});
|
|
|
@@ -245,27 +247,28 @@ var draw_graph = function (graphType, obj) {
|
|
|
ongoingTouches.push(touchfor[i]);
|
|
|
}
|
|
|
var ping =
|
|
|
- resolving == 0
|
|
|
- ? {
|
|
|
- data: {
|
|
|
- action: 0,
|
|
|
- count: ongoingTouches.length,
|
|
|
- pointerId: touchfor[i].identifier,
|
|
|
- x: acrossWidthX.toFixed(2),
|
|
|
- y: acrossHeightY.toFixed(2),
|
|
|
- },
|
|
|
- type: 'event',
|
|
|
- }
|
|
|
- : {
|
|
|
- data: {
|
|
|
- action: 0,
|
|
|
- count: ongoingTouches.length,
|
|
|
- pointerId: touchfor[i].identifier,
|
|
|
- x: verticalWidthX.toFixed(2),
|
|
|
- y: verticalHeightY.toFixed(2),
|
|
|
- },
|
|
|
- type: 'event',
|
|
|
- };
|
|
|
+ // resolving == 0
|
|
|
+ // ? {
|
|
|
+ // data: {
|
|
|
+ // action: 0,
|
|
|
+ // count: ongoingTouches.length,
|
|
|
+ // pointerId: touchfor[i].identifier,
|
|
|
+ // x: acrossWidthX.toFixed(2),
|
|
|
+ // y: acrossHeightY.toFixed(2),
|
|
|
+ // },
|
|
|
+ // type: 'event',
|
|
|
+ // }
|
|
|
+ // :
|
|
|
+ {
|
|
|
+ data: {
|
|
|
+ action: 0,
|
|
|
+ count: ongoingTouches.length,
|
|
|
+ pointerId: touchfor[i].identifier,
|
|
|
+ x: verticalWidthX.toFixed(2),
|
|
|
+ y: verticalHeightY.toFixed(2),
|
|
|
+ },
|
|
|
+ type: 'event',
|
|
|
+ };
|
|
|
wsss.send(JSON.stringify(ping));
|
|
|
}
|
|
|
canDraw = true;
|
|
|
@@ -279,33 +282,36 @@ var draw_graph = function (graphType, obj) {
|
|
|
var touchfor = e.originalEvent.changedTouches; //for 的手指数组
|
|
|
//是否横屏
|
|
|
for (var i = 0; i < touchfor.length; i++) {
|
|
|
- var acrossWidthX = touchfor[i].pageY * (videoHeight / voheight);
|
|
|
- var acrossHeightY =
|
|
|
- videoWidth - touchfor[i].pageX * (videoWidth / vowidth);
|
|
|
- var verticalWidthX = touchfor[i].pageX * (videoWidth / vowidth);
|
|
|
- var verticalHeightY = touchfor[i].pageY * (videoHeight / voheight);
|
|
|
+ // var acrossWidthX = touchfor[i].pageY * (videoHeight / voheight);
|
|
|
+ // var acrossHeightY =
|
|
|
+ // videoWidth - touchfor[i].pageX * (videoWidth / vowidth);
|
|
|
+ var verticalWidthX =
|
|
|
+ touchfor[i].pageX * (window.currentPhoneSize.width / vowidth);
|
|
|
+ var verticalHeightY =
|
|
|
+ touchfor[i].pageY * (window.currentPhoneSize.height / voheight);
|
|
|
var ping =
|
|
|
- resolving == 0
|
|
|
- ? {
|
|
|
- data: {
|
|
|
- action: 1,
|
|
|
- count: ongoingTouches.length,
|
|
|
- pointerId: touchfor[i].identifier,
|
|
|
- x: acrossWidthX.toFixed(2),
|
|
|
- y: acrossHeightY.toFixed(2),
|
|
|
- },
|
|
|
- type: 'event',
|
|
|
- }
|
|
|
- : {
|
|
|
- data: {
|
|
|
- action: 1,
|
|
|
- count: ongoingTouches.length,
|
|
|
- pointerId: touchfor[i].identifier,
|
|
|
- x: verticalWidthX.toFixed(2),
|
|
|
- y: verticalHeightY.toFixed(2),
|
|
|
- },
|
|
|
- type: 'event',
|
|
|
- };
|
|
|
+ // resolving == 0
|
|
|
+ // ? {
|
|
|
+ // data: {
|
|
|
+ // action: 1,
|
|
|
+ // count: ongoingTouches.length,
|
|
|
+ // pointerId: touchfor[i].identifier,
|
|
|
+ // x: acrossWidthX.toFixed(2),
|
|
|
+ // y: acrossHeightY.toFixed(2),
|
|
|
+ // },
|
|
|
+ // type: 'event',
|
|
|
+ // }
|
|
|
+ // :
|
|
|
+ {
|
|
|
+ data: {
|
|
|
+ action: 1,
|
|
|
+ count: ongoingTouches.length,
|
|
|
+ pointerId: touchfor[i].identifier,
|
|
|
+ x: verticalWidthX.toFixed(2),
|
|
|
+ y: verticalHeightY.toFixed(2),
|
|
|
+ },
|
|
|
+ type: 'event',
|
|
|
+ };
|
|
|
wsss.send(JSON.stringify(ping));
|
|
|
ongoingTouches.forEach(function (item, index) {
|
|
|
if (item.identifier === touchfor[i].identifier) {
|
|
|
@@ -328,33 +334,36 @@ var draw_graph = function (graphType, obj) {
|
|
|
}
|
|
|
var touchfor = e.originalEvent.targetTouches; //for 的手指数组
|
|
|
for (var i = 0; i < touchfor.length; i++) {
|
|
|
- var acrossWidthX = touchfor[i].pageY * (videoHeight / voheight);
|
|
|
- var acrossHeightY =
|
|
|
- videoWidth - touchfor[i].pageX * (videoWidth / vowidth);
|
|
|
- var verticalWidthX = touchfor[i].pageX * (videoWidth / vowidth);
|
|
|
- var verticalHeightY = touchfor[i].pageY * (videoHeight / voheight);
|
|
|
+ // var acrossWidthX = touchfor[i].pageY * (videoHeight / voheight);
|
|
|
+ // var acrossHeightY =
|
|
|
+ // videoWidth - touchfor[i].pageX * (videoWidth / vowidth);
|
|
|
+ var verticalWidthX =
|
|
|
+ touchfor[i].pageX * (window.currentPhoneSize.width / vowidth);
|
|
|
+ var verticalHeightY =
|
|
|
+ touchfor[i].pageY * (window.currentPhoneSize.height / voheight);
|
|
|
var ping =
|
|
|
- resolving == 0
|
|
|
- ? {
|
|
|
- data: {
|
|
|
- action: 2,
|
|
|
- count: touchfor.length,
|
|
|
- pointerId: touchfor[i].identifier,
|
|
|
- x: acrossWidthX.toFixed(2),
|
|
|
- y: acrossHeightY.toFixed(2),
|
|
|
- },
|
|
|
- type: 'event',
|
|
|
- }
|
|
|
- : {
|
|
|
- data: {
|
|
|
- action: 2,
|
|
|
- count: touchfor.length,
|
|
|
- pointerId: touchfor[i].identifier,
|
|
|
- x: verticalWidthX.toFixed(2),
|
|
|
- y: verticalHeightY.toFixed(2),
|
|
|
- },
|
|
|
- type: 'event',
|
|
|
- };
|
|
|
+ // resolving == 0
|
|
|
+ // ? {
|
|
|
+ // data: {
|
|
|
+ // action: 2,
|
|
|
+ // count: touchfor.length,
|
|
|
+ // pointerId: touchfor[i].identifier,
|
|
|
+ // x: acrossWidthX.toFixed(2),
|
|
|
+ // y: acrossHeightY.toFixed(2),
|
|
|
+ // },
|
|
|
+ // type: 'event',
|
|
|
+ // }
|
|
|
+ // :
|
|
|
+ {
|
|
|
+ data: {
|
|
|
+ action: 2,
|
|
|
+ count: touchfor.length,
|
|
|
+ pointerId: touchfor[i].identifier,
|
|
|
+ x: verticalWidthX.toFixed(2),
|
|
|
+ y: verticalHeightY.toFixed(2),
|
|
|
+ },
|
|
|
+ type: 'event',
|
|
|
+ };
|
|
|
wsss.send(JSON.stringify(ping));
|
|
|
}
|
|
|
};
|