6 lines
155 KiB
JavaScript
6 lines
155 KiB
JavaScript
|
/**
|
||
|
* AgoraWebSDK_N-v4.22.1-0-g1c8e27e9 Copyright AgoraInc.
|
||
|
*/
|
||
|
|
||
|
import"webrtc-adapter";import{getBrowserInfo as e,BrowserName as t,isChromeKernel as i,nextTick as r,isAboveChrome as o,isAboveFirefox as s,isAboveSafari as a,BrowserOS as n,isSafari as c,isWkWebview as d,getParameter as u,isFirefox as h,isChrome as l,isEdge as p,isMobile as m,checkValidConstrainLong as _,checkValidNumber as g,checkValidBoolean as E,checkValidEnum as T,AgoraRTCError as f,AgoraRTCErrorCode as v,isEmpty as y,EventEmitter as S,getRandomString as k,runOnce as b,AgoraAPIName as I,AgoraAPITag as A,PromiseMutex as w,emitAsPromiseNoResponse as R,removeItemFromList as D,isIOS as C,isIpadOS as N,wait as O,showElectronSelectSourceWindow as M,getElectronInstance as P,isElectron as L,recursiveMerge as V,isAndroid as x,isHarmonyOS as U,detectSecureContext as B,isAndroidChromium as F,domLoadedPromise as H,isIOS15 as G,emitAsPromise as W,noop as K,isLegacyChrome as z,isAboveEdge as j,isAboveOpera as Y,constrainLongToNumber as Z,hexToBytes as X,md5 as J,atom as Q,emitAsInvokerNoResponse as q,isIOS16 as $,retryable as ee,getOSWithVersion as te,isAboveIOS15_1 as ie,isInPage as re,isBetweenBrowser as oe,isWindows as se,elementVisibleChecker as ae,safeCloneJson as ne,jsonClone as ce,isAboveIOS15_2 as de,isWechatBrowser as ue}from"@agora-js/shared";export{isElectron}from"@agora-js/shared";import{logger as he,report as le,AgoraRTCEventUploadType as pe,apiInvoke as me}from"@agora-js/report";import _e from"axios";const ge={getDisplayMedia:!1,getStreamFromExtension:!1,supportUnifiedPlan:!1,supportMinBitrate:!1,supportSetRtpSenderParameters:!1,supportDualStream:!0,webAudioMediaStreamDest:!1,supportReplaceTrack:!1,supportWebGL:!1,webAudioWithAEC:!1,supportRequestFrame:!1,supportShareAudio:!1,supportDualStreamEncoding:!1,supportDataChannel:!1,supportPCSetConfiguration:!1,supportWebRTCEncodedTransform:!1,supportWebRTCInsertableStream:!1,supportRequestVideoFrameCallback:!1,supportWebCrypto:!1};function Ee(){const l=e();ge.getDisplayMedia=function(e){if(navigator.mediaDevices&&navigator.mediaDevices.getDisplayMedia)return!0;return!1}(),ge.getStreamFromExtension=l.name===t.CHROME&&Number(l.version)>34,ge.supportUnifiedPlan=function(){if(!window.RTCRtpTransceiver)return!1;if(!("currentDirection"in RTCRtpTransceiver.prototype))return!1;const e=new RTCPeerConnection;let t=!1;try{e.addTransceiver("audio"),t=!0}catch(e){}return e.close(),t}(),ge.supportMinBitrate=l.name===t.CHROME||l.name===t.EDGE,ge.supportSetRtpSenderParameters=function(){const r=e();if(!window.RTCRtpSender||!window.RTCRtpSender.prototype.setParameters||!window.RTCRtpSender.prototype.getParameters)return!1;return!!i()||(!(!c()&&!d())||r.name===t.FIREFOX&&Number(r.version)>=64)}(),l.name===t.SAFARI&&(Number(l.version)>=14?ge.supportDualStream=!0:ge.supportDualStream=!1),ge.webAudioMediaStreamDest=function(){const i=e();if(i.name===t.SAFARI&&Number(i.version)<12)return!1;return!0}(),ge.supportReplaceTrack=function(){if(!window.RTCRtpSender)return!1;if("function"==typeof RTCRtpSender.prototype.replaceTrack)return!0;return!1}(),ge.supportWebGL="undefined"!=typeof WebGLRenderingContext,ge.supportRequestFrame=!!window.CanvasCaptureMediaStreamTrack,i()||(ge.webAudioWithAEC=!0),ge.supportShareAudio=function(){const i=e();if((i.os===n.WIN_10||i.os===n.WIN_81||i.os===n.WIN_7||i.os===n.LINUX||i.os===n.MAC_OS||i.os===n.CHROMIUM_OS)&&i.name===t.CHROME&&Number(i.version)>=74)return!0;return!1}(),ge.supportDataChannel=function(){if(o(76)||s(68)||a(14))return!0;return!1}(),ge.supportPCSetConfiguration=function(){const e=window.RTCPeerConnection;return!h()&&!!e&&e.prototype.setConfiguration instanceof Function}(),ge.supportWebRTCEncodedTransform=function(){const t=e();return"Chrome"===t.name&&Number(t.version)>=86||"Safari"===t.name&&Number(t.version)>=15}(),ge.supportWebRTCInsertableStream=function(){const i=e();return(i.name===t.CHROME||i.name===t.EDGE)&&Number(i.version)>=94&&"MediaStreamTrackGenerator"in window&&"MediaStreamTrackProcessor"in window}(),ge.supportRequestVideoFrameCallback=function(){if("requestVideoFrameCallback"in HTMLVideoElement.prototype)return!0;return!1}(),ge.supp
|