"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./utils.js"),i=require("./chrome/chrome_shim.js"),r=require("./firefox/firefox_shim.js"),s=require("./safari/safari_shim.js"),a=require("./common_shim.js"),t=require("../../../sdp/sdp.js"),m=require("./firefox/getusermedia.js"),o=require("./chrome/getusermedia.js");exports.adapterFactory=function(){let{window:h}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{shimChrome:!0,shimFirefox:!0,shimSafari:!0};const d=e.log,c=e.detectBrowser(h),l={browserDetails:c,commonShim:a,extractVersion:e.extractVersion,disableLog:e.disableLog,disableWarnings:e.disableWarnings,sdp:t};switch(c.browser){case"chrome":if(!i||!i.shimPeerConnection||!n.shimChrome)return d("Chrome shim is not included in this adapter release."),l;if(null===c.version)return d("Chrome shim can not determine version, not shimming."),l;d("adapter.js shimming chrome."),l.browserShim=i,a.shimAddIceCandidateNullOrEmpty(h,c),a.shimParameterlessSetLocalDescription(h),o.shimGetUserMedia(h,c),i.shimMediaStream(h),i.shimPeerConnection(h,c),i.shimOnTrack(h,c),i.shimAddTrackRemoveTrack(h,c),i.shimGetSendersWithDtmf(h),i.shimSenderReceiverGetStats(h,c),i.fixNegotiationNeeded(h,c),a.shimRTCIceCandidate(h),a.shimRTCIceCandidateRelayProtocol(h),a.shimConnectionState(h),a.shimMaxMessageSize(h,c),a.shimSendThrowTypeError(h,c),a.removeExtmapAllowMixed(h,c);break;case"firefox":if(!r||!r.shimPeerConnection||!n.shimFirefox)return d("Firefox shim is not included in this adapter release."),l;d("adapter.js shimming firefox."),l.browserShim=r,a.shimAddIceCandidateNullOrEmpty(h,c),a.shimParameterlessSetLocalDescription(h),m.shimGetUserMedia(h,c),r.shimPeerConnection(h,c),r.shimGetStats(h,c),r.shimOnTrack(h),r.shimRemoveStream(h),r.shimSenderGetStats(h),r.shimReceiverGetStats(h),r.shimRTCDataChannel(h),r.shimAddTransceiver(h),r.shimGetParameters(h),r.shimCreateOffer(h),r.shimCreateAnswer(h),a.shimRTCIceCandidate(h),a.shimConnectionState(h),a.shimMaxMessageSize(h,c),a.shimSendThrowTypeError(h,c);break;case"safari":if(!s||!n.shimSafari)return d("Safari shim is not included in this adapter release."),l;d("adapter.js shimming safari."),l.browserShim=s,a.shimAddIceCandidateNullOrEmpty(h,c),a.shimParameterlessSetLocalDescription(h),s.shimRTCIceServerUrls(h),s.shimCreateOfferLegacy(h),s.shimCallbacksAPI(h),s.shimLocalStreamsAPI(h),s.shimRemoteStreamsAPI(h),s.shimTrackEventTransceiver(h),s.shimGetUserMedia(h),s.shimAudioContext(h),a.shimRTCIceCandidate(h),a.shimRTCIceCandidateRelayProtocol(h),a.shimMaxMessageSize(h,c),a.shimSendThrowTypeError(h,c),a.removeExtmapAllowMixed(h,c);break;default:d("Unsupported browser!")}return l};
//# sourceMappingURL=adapter_factory.js.map
