Skip to content

Commit

Permalink
move事件过滤
Browse files Browse the repository at this point in the history
  • Loading branch information
xiangyuecn committed Sep 3, 2019
1 parent e908cde commit b80066d
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions assets/zdemo.index.webrtc.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,12 +171,13 @@ var realTimeSendTryStop=function(recSet){


//按住发语音
var rtcVoiceStart,rtcVoiceDownHit;
var rtcVoiceStart,rtcVoiceDownEvent,rtcVoiceDownHit;
$("body").bind("mousedown touchstart",function(e){
var elem=$(".webrtcVoiceBtn");
if(e.target!=elem[0]){
return;
};
rtcVoiceDownEvent=e;

$("body").css("user-select","none");//kill all 免得渣渣浏览器里面复制搜索各种弹

Expand Down Expand Up @@ -219,8 +220,13 @@ $("body").bind("mousedown touchstart",function(e){
};
}).bind("mousemove touchmove",function(e){
if(rtcVoiceDownHit){
clearTimeout(rtcVoiceDownHit);
rtcVoiceDownHit=0;
var a=rtcVoiceDownEvent.originalEvent;
var b=e.originalEvent;
if(Math.abs(a.screenX-b.screenX)+Math.abs(a.screenY-b.screenY)>3*2){
$("body").css("user-select","");
clearTimeout(rtcVoiceDownHit);
rtcVoiceDownHit=0;
};
};
});

Expand Down

0 comments on commit b80066d

Please sign in to comment.