fix(tracks) Use duration from JitsiTrack (#10304)

This commit is contained in:
Robert Pintilii 2021-11-08 10:55:28 +02:00 committed by GitHub
parent bf36b22bbd
commit a97b700712
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 3 deletions

View File

@ -1551,7 +1551,7 @@ export default {
APP.store.dispatch(toggleScreenshotCaptureSummary(false));
}
const tracks = APP.store.getState()['features/base/tracks'];
const timestamp = getLocalVideoTrack(tracks)?.timestamp ?? 0;
const duration = getLocalVideoTrack(tracks)?.jitsiTrack.getDuration() ?? 0;
// It can happen that presenter GUM is in progress while screensharing is being turned off. Here it needs to
// wait for that GUM to be resolved in order to prevent leaking the presenter track(this.localPresenterVideo
@ -1614,7 +1614,7 @@ export default {
() => {
this.videoSwitchInProgress = false;
sendAnalytics(createScreenSharingEvent('stopped',
timestamp === 0 ? null : (Date.now() / 1000) - timestamp));
duration === 0 ? null : duration));
logger.info('Screen sharing stopped.');
},
error => {

View File

@ -57,7 +57,6 @@ MiddlewareRegistry.register(store => next => action => {
// The devices list needs to be refreshed when no initial video permissions
// were granted and a local video track is added by umuting the video.
if (action.track.local) {
action.track.timestamp = Date.now() / 1000;
store.dispatch(getAvailableDevices());
}