mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Update session ping
This commit is contained in:
parent
5342b90a56
commit
9839dcd02a
2 changed files with 21 additions and 1 deletions
|
@ -99,6 +99,7 @@
|
||||||
"src/components/scrollManager.js",
|
"src/components/scrollManager.js",
|
||||||
"src/components/syncplay/playbackPermissionManager.js",
|
"src/components/syncplay/playbackPermissionManager.js",
|
||||||
"src/components/syncplay/groupSelectionMenu.js",
|
"src/components/syncplay/groupSelectionMenu.js",
|
||||||
|
"src/components/syncplay/timeSyncManager.js",
|
||||||
"src/components/syncplay/syncplayManager.js",
|
"src/components/syncplay/syncplayManager.js",
|
||||||
"src/scripts/dfnshelper.js",
|
"src/scripts/dfnshelper.js",
|
||||||
"src/scripts/dom.js",
|
"src/scripts/dom.js",
|
||||||
|
|
|
@ -99,7 +99,7 @@ class SyncplayManager {
|
||||||
this.syncPlaybackTime();
|
this.syncPlaybackTime();
|
||||||
});
|
});
|
||||||
|
|
||||||
events.on(timeSyncManager, "Update", (event, timeOffset, ping) => {
|
events.on(timeSyncManager, "Update", (event, timeOffset, ping) => {
|
||||||
this.timeOffsetWithServer = timeOffset;
|
this.timeOffsetWithServer = timeOffset;
|
||||||
this.roundTripDuration = ping * 2;
|
this.roundTripDuration = ping * 2;
|
||||||
|
|
||||||
|
@ -108,6 +108,25 @@ class SyncplayManager {
|
||||||
events.trigger(this, "SyncplayReady");
|
events.trigger(this, "SyncplayReady");
|
||||||
this.notifySyncplayReady = false;
|
this.notifySyncplayReady = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Report ping
|
||||||
|
if (this.syncEnabled) {
|
||||||
|
const apiClient = connectionManager.currentApiClient();
|
||||||
|
const sessionId = getActivePlayerId();
|
||||||
|
|
||||||
|
if (!sessionId) {
|
||||||
|
this.signalError();
|
||||||
|
toast({
|
||||||
|
// TODO: translate
|
||||||
|
text: "Syncplay error occured."
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
apiClient.sendSyncplayCommand(sessionId, "UpdatePing", {
|
||||||
|
Ping: ping
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue