|
| 1 | +diff --git a/lib/dataconnection.ts b/lib/dataconnection.ts |
| 2 | +index ab58d6c..dfbf3b2 100644 |
| 3 | +--- a/lib/dataconnection.ts |
| 4 | ++++ b/lib/dataconnection.ts |
| 5 | +@@ -56,7 +56,7 @@ export class DataConnection extends BaseConnection { |
| 6 | + this.options.connectionId || DataConnection.ID_PREFIX + util.randomToken(); |
| 7 | + |
| 8 | + this.label = this.options.label || this.connectionId; |
| 9 | +- this.serialization = this.options.serialization || SerializationType.Binary; |
| 10 | ++ this.serialization = this.options.serialization || SerializationType.JSON; |
| 11 | + this.reliable = !!this.options.reliable; |
| 12 | + |
| 13 | + if (this.options._payload) { |
| 14 | +diff --git a/lib/exports.ts b/lib/exports.ts |
| 15 | +index 5772d02..07fc457 100644 |
| 16 | +--- a/lib/exports.ts |
| 17 | ++++ b/lib/exports.ts |
| 18 | +@@ -8,6 +8,3 @@ export const peerjs = { |
| 19 | + |
| 20 | + export default Peer; |
| 21 | + |
| 22 | +-(<any>window).peerjs = peerjs; |
| 23 | +-/** @deprecated Should use peerjs namespace */ |
| 24 | +-(<any>window).Peer = Peer; |
| 25 | +diff --git a/lib/peer.ts b/lib/peer.ts |
| 26 | +index 66a3412..78ac6cf 100644 |
| 27 | +--- a/lib/peer.ts |
| 28 | ++++ b/lib/peer.ts |
| 29 | +@@ -111,11 +111,6 @@ export class Peer extends EventEmitter { |
| 30 | + }; |
| 31 | + this._options = options; |
| 32 | + |
| 33 | +- // Detect relative URL host. |
| 34 | +- if (this._options.host === "/") { |
| 35 | +- this._options.host = window.location.hostname; |
| 36 | +- } |
| 37 | +- |
| 38 | + // Set path correctly. |
| 39 | + if (this._options.path) { |
| 40 | + if (this._options.path[0] !== "/") { |
| 41 | +diff --git a/lib/supports.ts b/lib/supports.ts |
| 42 | +index 1801188..8bb163e 100644 |
| 43 | +--- a/lib/supports.ts |
| 44 | ++++ b/lib/supports.ts |
| 45 | +@@ -1,5 +1,3 @@ |
| 46 | +-import { webRTCAdapter } from './adapter'; |
| 47 | +- |
| 48 | + export const Supports = new class { |
| 49 | + readonly isIOS = ['iPad', 'iPhone', 'iPod'].includes(navigator.platform); |
| 50 | + readonly supportedBrowsers = ['firefox', 'chrome', 'safari']; |
| 51 | +@@ -28,36 +26,15 @@ export const Supports = new class { |
| 52 | + } |
| 53 | + |
| 54 | + getBrowser(): string { |
| 55 | +- return webRTCAdapter.browserDetails.browser; |
| 56 | ++ return 'chrome'; |
| 57 | + } |
| 58 | + |
| 59 | + getVersion(): number { |
| 60 | +- return webRTCAdapter.browserDetails.version || 0; |
| 61 | ++ return this.minChromeVersion; |
| 62 | + } |
| 63 | + |
| 64 | + isUnifiedPlanSupported(): boolean { |
| 65 | +- const browser = this.getBrowser(); |
| 66 | +- const version = webRTCAdapter.browserDetails.version || 0; |
| 67 | +- |
| 68 | +- if (browser === 'chrome' && version < 72) return false; |
| 69 | +- if (browser === 'firefox' && version >= 59) return true; |
| 70 | +- if (!window.RTCRtpTransceiver || !('currentDirection' in RTCRtpTransceiver.prototype)) return false; |
| 71 | +- |
| 72 | +- let tempPc: RTCPeerConnection; |
| 73 | +- let supported = false; |
| 74 | +- |
| 75 | +- try { |
| 76 | +- tempPc = new RTCPeerConnection(); |
| 77 | +- tempPc.addTransceiver('audio'); |
| 78 | +- supported = true; |
| 79 | +- } catch (e) { } |
| 80 | +- finally { |
| 81 | +- if (tempPc) { |
| 82 | +- tempPc.close(); |
| 83 | +- } |
| 84 | +- } |
| 85 | +- |
| 86 | +- return supported; |
| 87 | ++ return false; |
| 88 | + } |
| 89 | + |
| 90 | + toString(): string { |
0 commit comments