diff --git a/assets/zdemo.index.webrtc.js b/assets/zdemo.index.webrtc.js index 654b94c..c9d2c85 100644 --- a/assets/zdemo.index.webrtc.js +++ b/assets/zdemo.index.webrtc.js @@ -79,12 +79,30 @@ function webrtcOpen(){ if($(".realTimeSend").val()=="996"){ $(".realTimeSend").val(500); }; + rtcStatusView(); +}; +function webrtcClose(){ + rtcStatusView(); +}; +function webrtcCloseClick(){ + if(rtcConn){ + rtcConn.close(); + }; }; var rtcStatusView=function(){ - rtcStatus.html('
发送:'+rtcSendMime+" "+rtcSendLen+"b "+rtcSendCount+"片 共"+rtcBitF(rtcSendSize)+" Skip:"+rtcSendSkip+"片
" - +'
接收:'+rtcRecMime+" "+rtcRecLen+"b "+rtcRecCount+"片 共"+rtcBitF(rtcRecSize)+" Skip:"+rtcRecSkip+"片 PlayMode:"+rtcPlayMode+"
"); + var html=[]; + if(rtcChannelOpen){ + html.push('
'); + }else{ + html.push("连接已关闭,停止数据收发"); + }; + + html.push('
发送:'+rtcSendMime+" "+rtcSendLen+"b "+rtcSendCount+"片 共"+rtcBitF(rtcSendSize)+" Skip:"+rtcSendSkip+"片
"); + html.push('
接收:'+rtcRecMime+" "+rtcRecLen+"b "+rtcRecCount+"片 共"+rtcBitF(rtcRecSize)+" Skip:"+rtcRecSkip+"片 PlayMode:"+rtcPlayMode+"
"); + + rtcStatus.html(html.join("\n")); }; var rtcBitF=function(size){ if(size<1024*900){ @@ -105,7 +123,7 @@ var rtcStatus=$(".webrtcStatus"); //*****语音流播放***** var rtcPlayBuffer=[]; var rtcPlayModeDecode=$(".webrtcPlayModeDecode")[0]; -var rtcPlayMode=""; +var rtcPlayMode="-"; var rtcPlay=function(){ if(rtcPlayModeDecode.checked){ rtcPlayMode="decode"; @@ -161,12 +179,12 @@ var rtcDecodePlay=function(decode){ var pd=itm.duration; var duration=sd; var arr=pcm; - if(pd