Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

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

Robert Pintiliia97b7007129d
diff --git a/conference.js b/conference.js
index 55c2d648d6..42d74428d7 100644
--- a/conference.js
+++ b/conference.js
@@ -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 => {
diff --git a/react/features/base/tracks/middleware.js b/react/features/base/tracks/middleware.js
index 5de85954aa..b0ca3881ef 100644
--- a/react/features/base/tracks/middleware.js
+++ b/react/features/base/tracks/middleware.js
@@ -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());
}