@100mslive/hms-video-store
Advanced tools
Comparing version 0.12.17-alpha.19 to 0.12.17-alpha.20
{ | ||
"version": "0.12.17-alpha.19", | ||
"version": "0.12.17-alpha.20", | ||
"license": "MIT", | ||
@@ -76,3 +76,3 @@ "repository": { | ||
], | ||
"gitHead": "2fbdfe8caf300c22658c998b2c549ebc8988af7b" | ||
"gitHead": "5cbec3cfca6748ed41589662da938d79f8290ac8" | ||
} |
@@ -671,2 +671,13 @@ import { JoinParameters } from './models/JoinParameters'; | ||
private createPeerConnections() { | ||
const logConnectionState = ( | ||
role: HMSConnectionRole, | ||
newState: RTCIceConnectionState | RTCPeerConnectionState, | ||
ice = false, | ||
) => { | ||
const log = ['disconnected', 'failed'].includes(newState) | ||
? HMSLogger.w.bind(HMSLogger) | ||
: HMSLogger.d.bind(HMSLogger); | ||
log(TAG, `${HMSConnectionRole[role]} ${ice ? 'ice' : ''} connection state change: ${newState}`); | ||
}; | ||
if (this.initConfig) { | ||
@@ -725,9 +736,7 @@ const publishConnectionObserver: IPublishConnectionObserver = { | ||
onIceConnectionChange: async (newState: RTCIceConnectionState) => { | ||
const log = newState === 'disconnected' ? HMSLogger.w.bind(HMSLogger) : HMSLogger.d.bind(HMSLogger); | ||
log(TAG, `Publish ice connection state change: ${newState}`); | ||
logConnectionState(HMSConnectionRole.Publish, newState, true); | ||
}, | ||
onConnectionStateChange: async (newState: RTCPeerConnectionState) => { | ||
const log = newState === 'disconnected' ? HMSLogger.w.bind(HMSLogger) : HMSLogger.d.bind(HMSLogger); | ||
log(TAG, `Publish connection state change: ${newState}`); | ||
logConnectionState(HMSConnectionRole.Publish, newState, false); | ||
if (newState === 'new') { | ||
@@ -788,4 +797,3 @@ return; | ||
onIceConnectionChange: async (newState: RTCIceConnectionState) => { | ||
const log = newState === 'disconnected' ? HMSLogger.w.bind(HMSLogger) : HMSLogger.d.bind(HMSLogger); | ||
log(TAG, `Subscribe ice connection state change: ${newState}`); | ||
logConnectionState(HMSConnectionRole.Subscribe, newState, true); | ||
@@ -804,4 +812,3 @@ if (newState === 'connected') { | ||
onConnectionStateChange: async (newState: RTCPeerConnectionState) => { | ||
const log = newState === 'disconnected' ? HMSLogger.w.bind(HMSLogger) : HMSLogger.d.bind(HMSLogger); | ||
log(TAG, `Subscribe connection state change: ${newState}`); | ||
logConnectionState(HMSConnectionRole.Subscribe, newState, false); | ||
@@ -1012,2 +1019,3 @@ if (newState === 'failed') { | ||
if (!callback) { | ||
HMSLogger.w(TAG, 'no callback found for renegotiation'); | ||
return; | ||
@@ -1041,5 +1049,5 @@ } | ||
if (ex.code === 421) { | ||
callback!.promise.resolve(true); | ||
callback.promise.resolve(true); | ||
} else { | ||
callback!.promise.reject(ex); | ||
callback.promise.reject(ex); | ||
} | ||
@@ -1226,3 +1234,11 @@ HMSLogger.d(TAG, `[role=PUBLISH] onRenegotiationNeeded FAILED ❌`); | ||
if (this.publishConnection) { | ||
const p = new Promise<boolean>((resolve, reject) => { | ||
this.callbacks.set(RENEGOTIATION_CALLBACK_ID, { | ||
promise: { resolve, reject }, | ||
action: HMSAction.RESTART_ICE, | ||
extra: {}, | ||
}); | ||
}); | ||
await this.performPublishRenegotiation({ iceRestart: this.publishConnection.connectionState !== 'connected' }); | ||
await p; | ||
} | ||
@@ -1229,0 +1245,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4742683
40298