ovenplayer 0.10.49 → 0.10.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ovenplayer",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.50",
|
|
4
4
|
"description": "OvenPlayer is Open-Source HTML5 Player. OvenPlayer supports WebRTC Signaling from OvenMediaEngine for Sub-Second Latency Streaming.",
|
|
5
5
|
"main": "dist/ovenplayer.js",
|
|
6
6
|
"scripts": {
|
|
@@ -34,6 +34,8 @@ const WebRTCLoader = function (provider,
|
|
|
34
34
|
let ws = null;
|
|
35
35
|
let wsConnected = false;
|
|
36
36
|
|
|
37
|
+
let transportPolicy = getTransportQuery(webSocketUrl);
|
|
38
|
+
|
|
37
39
|
let mainStream = null;
|
|
38
40
|
|
|
39
41
|
// used for getting media stream from OME or host peer
|
|
@@ -81,6 +83,24 @@ const WebRTCLoader = function (provider,
|
|
|
81
83
|
}
|
|
82
84
|
})();
|
|
83
85
|
|
|
86
|
+
function getTransportQuery(webSocketUrl) {
|
|
87
|
+
|
|
88
|
+
try {
|
|
89
|
+
const url = new URL(webSocketUrl);
|
|
90
|
+
const transport = url.searchParams.get('transport');
|
|
91
|
+
|
|
92
|
+
if (transport === null) {
|
|
93
|
+
return undefined;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
const normalized = transport.toLowerCase();
|
|
97
|
+
|
|
98
|
+
return normalized;
|
|
99
|
+
|
|
100
|
+
} catch (e) {
|
|
101
|
+
return undefined;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
84
104
|
|
|
85
105
|
function getPeerConnectionById(id) {
|
|
86
106
|
|
|
@@ -257,6 +277,7 @@ const WebRTCLoader = function (provider,
|
|
|
257
277
|
} else if (iceServers) {
|
|
258
278
|
|
|
259
279
|
// second priority using ice servers from ome and force using TCP
|
|
280
|
+
|
|
260
281
|
peerConnectionConfig.iceServers = [];
|
|
261
282
|
|
|
262
283
|
for (let i = 0; i < iceServers.length; i++) {
|
|
@@ -299,8 +320,20 @@ const WebRTCLoader = function (provider,
|
|
|
299
320
|
peerConnectionConfig.iceServers.push(regIceServer);
|
|
300
321
|
}
|
|
301
322
|
|
|
302
|
-
|
|
323
|
+
// webrtcConfig.iceTransportPolicy has first priority than transport query for iceTransportPolicy because it is more specific setting for player.
|
|
324
|
+
if (playerConfig.getConfig().webrtcConfig &&
|
|
325
|
+
playerConfig.getConfig().webrtcConfig.iceTransportPolicy) {
|
|
326
|
+
peerConnectionConfig.iceTransportPolicy = playerConfig.getConfig().webrtcConfig.iceTransportPolicy;
|
|
327
|
+
} else {
|
|
328
|
+
|
|
329
|
+
let iceTransportPolicy = 'relay';
|
|
330
|
+
|
|
331
|
+
if (transportPolicy === 'all') {
|
|
332
|
+
iceTransportPolicy = 'all';
|
|
333
|
+
}
|
|
303
334
|
|
|
335
|
+
peerConnectionConfig.iceTransportPolicy = iceTransportPolicy;
|
|
336
|
+
}
|
|
304
337
|
} else {
|
|
305
338
|
|
|
306
339
|
// last priority using default ice servers.
|