@scrypted/client
Advanced tools
Comparing version 1.0.59 to 1.0.60
@@ -228,4 +228,6 @@ "use strict"; | ||
const connectionManagementId = `connectionManagement-${Math.random()}`; | ||
const updateSessionId = `updateSessionId-${Math.random()}`; | ||
ready.send(JSON.stringify({ | ||
pluginId, | ||
updateSessionId, | ||
connectionManagementId, | ||
@@ -290,2 +292,3 @@ })); | ||
ret.params['connectionManagementId'] = connectionManagementId; | ||
ret.params['updateSessionId'] = updateSessionId; | ||
ret.params['browserSignalingSession'] = session; | ||
@@ -370,3 +373,13 @@ (0, rtc_signaling_1.waitPeerIceConnectionClosed)(pc).then(() => ready.close()); | ||
console.log('api attached', Date.now() - start); | ||
const { browserSignalingSession, connectionManagementId } = rpcPeer.params; | ||
const { browserSignalingSession, connectionManagementId, updateSessionId } = rpcPeer.params; | ||
if (updateSessionId && browserSignalingSession) { | ||
systemManager.getComponent('plugins').then(async (plugins) => { | ||
const updateSession = await plugins.getHostParam('@scrypted/webrtc', updateSessionId); | ||
if (!updateSession) | ||
return; | ||
updateSession?.(browserSignalingSession); | ||
socket.removeAllListeners(); | ||
socket.close(); | ||
}); | ||
} | ||
const [userStorage, version, rtcConnectionManagement] = await Promise.all([ | ||
@@ -373,0 +386,0 @@ rpcPeer.getParam('userStorage'), |
{ | ||
"name": "@scrypted/client", | ||
"version": "1.0.59", | ||
"version": "1.0.60", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/packages/client/src/index.js", |
@@ -1,2 +0,2 @@ | ||
import { ScryptedStatic, RTCConnectionManagement } from "@scrypted/types"; | ||
import { ScryptedStatic, RTCConnectionManagement, RTCSignalingSession } from "@scrypted/types"; | ||
import axios, { AxiosRequestConfig } from 'axios'; | ||
@@ -263,4 +263,6 @@ import * as eio from 'engine.io-client'; | ||
const connectionManagementId = `connectionManagement-${Math.random()}`; | ||
const updateSessionId = `updateSessionId-${Math.random()}`; | ||
ready.send(JSON.stringify({ | ||
pluginId, | ||
updateSessionId, | ||
connectionManagementId, | ||
@@ -335,2 +337,3 @@ })); | ||
ret.params['connectionManagementId'] = connectionManagementId; | ||
ret.params['updateSessionId'] = updateSessionId; | ||
ret.params['browserSignalingSession'] = session; | ||
@@ -430,3 +433,13 @@ | ||
const { browserSignalingSession, connectionManagementId } = rpcPeer.params; | ||
const { browserSignalingSession, connectionManagementId, updateSessionId } = rpcPeer.params; | ||
if (updateSessionId && browserSignalingSession) { | ||
systemManager.getComponent('plugins').then(async plugins => { | ||
const updateSession: (session: RTCSignalingSession)=> void = await plugins.getHostParam('@scrypted/webrtc', updateSessionId); | ||
if (!updateSession) | ||
return; | ||
updateSession?.(browserSignalingSession); | ||
socket.removeAllListeners(); | ||
socket.close(); | ||
}); | ||
} | ||
@@ -433,0 +446,0 @@ const [userStorage, version, rtcConnectionManagement] = await Promise.all([ |
Sorry, the diff of this file is not supported yet
329785
3451