diff --git a/lib/dataconnection.ts b/lib/dataconnection.ts index ab58d6c..dfbf3b2 100644 --- a/lib/dataconnection.ts +++ b/lib/dataconnection.ts @@ -56,7 +56,7 @@ export class DataConnection extends BaseConnection { this.options.connectionId || DataConnection.ID_PREFIX + util.randomToken(); this.label = this.options.label || this.connectionId; - this.serialization = this.options.serialization || SerializationType.Binary; + this.serialization = this.options.serialization || SerializationType.JSON; this.reliable = !!this.options.reliable; if (this.options._payload) { diff --git a/lib/exports.ts b/lib/exports.ts index 5772d02..07fc457 100644 --- a/lib/exports.ts +++ b/lib/exports.ts @@ -8,6 +8,3 @@ export const peerjs = { export default Peer; -(window).peerjs = peerjs; -/** @deprecated Should use peerjs namespace */ -(window).Peer = Peer; diff --git a/lib/peer.ts b/lib/peer.ts index 66a3412..78ac6cf 100644 --- a/lib/peer.ts +++ b/lib/peer.ts @@ -111,11 +111,6 @@ export class Peer extends EventEmitter { }; this._options = options; - // Detect relative URL host. - if (this._options.host === "/") { - this._options.host = window.location.hostname; - } - // Set path correctly. if (this._options.path) { if (this._options.path[0] !== "/") { diff --git a/lib/supports.ts b/lib/supports.ts index 1801188..8bb163e 100644 --- a/lib/supports.ts +++ b/lib/supports.ts @@ -1,5 +1,3 @@ -import { webRTCAdapter } from './adapter'; - export const Supports = new class { readonly isIOS = ['iPad', 'iPhone', 'iPod'].includes(navigator.platform); readonly supportedBrowsers = ['firefox', 'chrome', 'safari']; @@ -28,36 +26,15 @@ export const Supports = new class { } getBrowser(): string { - return webRTCAdapter.browserDetails.browser; + return 'chrome'; } getVersion(): number { - return webRTCAdapter.browserDetails.version || 0; + return this.minChromeVersion; } isUnifiedPlanSupported(): boolean { - const browser = this.getBrowser(); - const version = webRTCAdapter.browserDetails.version || 0; - - if (browser === 'chrome' && version < 72) return false; - if (browser === 'firefox' && version >= 59) return true; - if (!window.RTCRtpTransceiver || !('currentDirection' in RTCRtpTransceiver.prototype)) return false; - - let tempPc: RTCPeerConnection; - let supported = false; - - try { - tempPc = new RTCPeerConnection(); - tempPc.addTransceiver('audio'); - supported = true; - } catch (e) { } - finally { - if (tempPc) { - tempPc.close(); - } - } - - return supported; + return false; } toString(): string {