aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/SyncPlay
diff options
context:
space:
mode:
authorIonut Andrei Oanca <oancaionutandrei@gmail.com>2020-12-04 23:16:15 +0100
committerIonut Andrei Oanca <oancaionutandrei@gmail.com>2020-12-04 23:16:15 +0100
commitcc64ee483d6620319d148ad27dbd1e26d8195ea6 (patch)
treeebf29a03c24a497664cbc5c86776f321e9107138 /Emby.Server.Implementations/SyncPlay
parent23473ef8fb2fb7bb1004f1748d67e0ff03354765 (diff)
Reorder parameters in HandleRequest
Diffstat (limited to 'Emby.Server.Implementations/SyncPlay')
-rw-r--r--Emby.Server.Implementations/SyncPlay/Group.cs10
-rw-r--r--Emby.Server.Implementations/SyncPlay/SyncPlayManager.cs1
2 files changed, 11 insertions, 0 deletions
diff --git a/Emby.Server.Implementations/SyncPlay/Group.cs b/Emby.Server.Implementations/SyncPlay/Group.cs
index b5031b708..7c2ad2477 100644
--- a/Emby.Server.Implementations/SyncPlay/Group.cs
+++ b/Emby.Server.Implementations/SyncPlay/Group.cs
@@ -332,6 +332,16 @@ namespace Emby.Server.Implementations.SyncPlay
// and notify clients of state changes. The actual syncing of media playback
// happens client side. Clients are aware of the server's time and use it to sync.
_logger.LogInformation("Session {SessionId} requested {RequestType} in group {GroupId} that is {StateType}.", session.Id, request.Action, GroupId.ToString(), _state.Type);
+
+ // Apply requested changes to this group given its current state.
+ // Every request has a slightly different outcome depending on the group's state.
+ // There are currently four different group states that accomplish different goals:
+ // - Idle: in this state no media is playing and clients should be idle (playback is stopped).
+ // - Waiting: in this state the group is waiting for all the clients to be ready to start the playback,
+ // that is, they've either finished loading the media for the first time or they've finished buffering.
+ // Once all clients report to be ready the group's state can change to Playing or Paused.
+ // - Playing: clients have some media loaded and playback is unpaused.
+ // - Paused: clients have some media loaded but playback is currently paused.
request.Apply(this, _state, session, cancellationToken);
}
diff --git a/Emby.Server.Implementations/SyncPlay/SyncPlayManager.cs b/Emby.Server.Implementations/SyncPlay/SyncPlayManager.cs
index e43f5c2c3..348213ee1 100644
--- a/Emby.Server.Implementations/SyncPlay/SyncPlayManager.cs
+++ b/Emby.Server.Implementations/SyncPlay/SyncPlayManager.cs
@@ -305,6 +305,7 @@ namespace Emby.Server.Implementations.SyncPlay
return;
}
+ // Apply requested changes to group.
group.HandleRequest(session, request, cancellationToken);
}
}