@100mslive/hms-video-store
Advanced tools
Comparing version 0.12.17-alpha.7 to 0.12.17-alpha.8
{ | ||
"version": "0.12.17-alpha.7", | ||
"version": "0.12.17-alpha.8", | ||
"license": "MIT", | ||
@@ -76,3 +76,3 @@ "repository": { | ||
], | ||
"gitHead": "a3858015ba34995efa28cd6e7ce1be842fc8b000" | ||
"gitHead": "1b1b22f648b766dd8d23974f0062da49dec42145" | ||
} |
@@ -87,3 +87,3 @@ import isEqual from 'lodash.isequal'; | ||
this.setFirstTrackId(this.trackId); | ||
if (isBrowser && source === 'regular') { | ||
if (isBrowser && source === 'regular' && isMobile()) { | ||
document.addEventListener('visibilitychange', this.handleVisibilityChange); | ||
@@ -523,31 +523,22 @@ } | ||
if (document.visibilityState === 'hidden') { | ||
if (isMobile()) { | ||
this.enabledStateBeforeBackground = this.enabled; | ||
this.nativeTrack.enabled = false; | ||
HMSLogger.d(this.TAG, 'visibility hidden muting track'); | ||
this.replaceSenderTrack(this.nativeTrack); | ||
// started interruption event | ||
this.eventBus.analytics.publish( | ||
this.sendInterruptionEvent({ | ||
started: true, | ||
}), | ||
); | ||
} | ||
this.enabledStateBeforeBackground = this.enabled; | ||
this.nativeTrack.enabled = false; | ||
HMSLogger.d(this.TAG, 'visibility hidden muting track'); | ||
this.replaceSenderTrack(this.nativeTrack); | ||
// started interruption event | ||
this.eventBus.analytics.publish( | ||
this.sendInterruptionEvent({ | ||
started: true, | ||
}), | ||
); | ||
} else { | ||
const newEnabledState = isMobile() ? this.enabledStateBeforeBackground : this.enabled; | ||
if (this.nativeTrack.muted || this.nativeTrack.readyState === 'ended') { | ||
HMSLogger.d(this.TAG, 'visibility visible, restarting track', `${this}`); | ||
const track = await this.replaceTrackWith(this.settings); | ||
this.nativeTrack?.stop(); | ||
this.nativeTrack = track; | ||
if (newEnabledState) { | ||
await this.processPlugins(); | ||
await this.pluginsManager.waitForRestart(); | ||
} | ||
await this.replaceSender(this.nativeTrack, newEnabledState); | ||
this.videoHandler.updateSinks(); | ||
} else if (isMobile()) { | ||
this.nativeTrack.enabled = this.enabledStateBeforeBackground; | ||
await this.replaceSender(this.nativeTrack, this.enabledStateBeforeBackground); | ||
} | ||
this.nativeTrack.enabled = this.enabledStateBeforeBackground; | ||
HMSLogger.d(this.TAG, 'visibility visibile, restoring track state', this.enabledStateBeforeBackground); | ||
this.replaceSender(this.nativeTrack, this.enabledStateBeforeBackground); | ||
// started interruption event | ||
this.eventBus.analytics.publish( | ||
this.sendInterruptionEvent({ | ||
started: false, | ||
}), | ||
); | ||
} | ||
@@ -554,0 +545,0 @@ this.eventBus.localVideoEnabled.publish({ enabled: this.nativeTrack.enabled, track: this }); |
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
4723424
40180