mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-05-30 20:38:27 +01:00
Implement syncplay backend
This commit is contained in:
38
MediaBrowser.Model/Syncplay/GroupInfoModel.cs
Normal file
38
MediaBrowser.Model/Syncplay/GroupInfoModel.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
namespace MediaBrowser.Model.Syncplay
|
||||
{
|
||||
/// <summary>
|
||||
/// Class GroupInfoModel.
|
||||
/// </summary>
|
||||
public class GroupInfoView
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the group identifier.
|
||||
/// </summary>
|
||||
/// <value>The group identifier.</value>
|
||||
public string GroupId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the playing item id.
|
||||
/// </summary>
|
||||
/// <value>The playing item id.</value>
|
||||
public string PlayingItemId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the playing item name.
|
||||
/// </summary>
|
||||
/// <value>The playing item name.</value>
|
||||
public string PlayingItemName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the position ticks.
|
||||
/// </summary>
|
||||
/// <value>The position ticks.</value>
|
||||
public long PositionTicks { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the partecipants.
|
||||
/// </summary>
|
||||
/// <value>The partecipants.</value>
|
||||
public string[] Partecipants { get; set; }
|
||||
}
|
||||
}
|
||||
32
MediaBrowser.Model/Syncplay/SyncplayCommand.cs
Normal file
32
MediaBrowser.Model/Syncplay/SyncplayCommand.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
namespace MediaBrowser.Model.Syncplay
|
||||
{
|
||||
/// <summary>
|
||||
/// Class SyncplayCommand.
|
||||
/// </summary>
|
||||
public class SyncplayCommand
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the group identifier.
|
||||
/// </summary>
|
||||
/// <value>The group identifier.</value>
|
||||
public string GroupId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the UTC time when to execute the command.
|
||||
/// </summary>
|
||||
/// <value>The UTC time when to execute the command.</value>
|
||||
public string When { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the position ticks.
|
||||
/// </summary>
|
||||
/// <value>The position ticks.</value>
|
||||
public long? PositionTicks { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the command.
|
||||
/// </summary>
|
||||
/// <value>The command.</value>
|
||||
public SyncplayCommandType Command { get; set; }
|
||||
}
|
||||
}
|
||||
21
MediaBrowser.Model/Syncplay/SyncplayCommandType.cs
Normal file
21
MediaBrowser.Model/Syncplay/SyncplayCommandType.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
namespace MediaBrowser.Model.Syncplay
|
||||
{
|
||||
/// <summary>
|
||||
/// Enum SyncplayCommandType.
|
||||
/// </summary>
|
||||
public enum SyncplayCommandType
|
||||
{
|
||||
/// <summary>
|
||||
/// The play command. Instructs users to start playback.
|
||||
/// </summary>
|
||||
Play = 0,
|
||||
/// <summary>
|
||||
/// The pause command. Instructs users to pause playback.
|
||||
/// </summary>
|
||||
Pause = 1,
|
||||
/// <summary>
|
||||
/// The seek command. Instructs users to seek to a specified time.
|
||||
/// </summary>
|
||||
Seek = 2
|
||||
}
|
||||
}
|
||||
26
MediaBrowser.Model/Syncplay/SyncplayGroupUpdate.cs
Normal file
26
MediaBrowser.Model/Syncplay/SyncplayGroupUpdate.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
namespace MediaBrowser.Model.Syncplay
|
||||
{
|
||||
/// <summary>
|
||||
/// Class SyncplayGroupUpdate.
|
||||
/// </summary>
|
||||
public class SyncplayGroupUpdate<T>
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the group identifier.
|
||||
/// </summary>
|
||||
/// <value>The group identifier.</value>
|
||||
public string GroupId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the update type.
|
||||
/// </summary>
|
||||
/// <value>The update type.</value>
|
||||
public SyncplayGroupUpdateType Type { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the data.
|
||||
/// </summary>
|
||||
/// <value>The data.</value>
|
||||
public T Data { get; set; }
|
||||
}
|
||||
}
|
||||
41
MediaBrowser.Model/Syncplay/SyncplayGroupUpdateType.cs
Normal file
41
MediaBrowser.Model/Syncplay/SyncplayGroupUpdateType.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
namespace MediaBrowser.Model.Syncplay
|
||||
{
|
||||
/// <summary>
|
||||
/// Enum SyncplayGroupUpdateType
|
||||
/// </summary>
|
||||
public enum SyncplayGroupUpdateType
|
||||
{
|
||||
/// <summary>
|
||||
/// The user-joined update. Tells members of a group about a new user.
|
||||
/// </summary>
|
||||
UserJoined = 0,
|
||||
/// <summary>
|
||||
/// The user-left update. Tells members of a group that a user left.
|
||||
/// </summary>
|
||||
UserLeft = 1,
|
||||
/// <summary>
|
||||
/// The group-joined update. Tells a user that the group has been joined.
|
||||
/// </summary>
|
||||
GroupJoined = 2,
|
||||
/// <summary>
|
||||
/// The group-left update. Tells a user that the group has been left.
|
||||
/// </summary>
|
||||
GroupLeft = 3,
|
||||
/// <summary>
|
||||
/// The group-wait update. Tells members of the group that a user is buffering.
|
||||
/// </summary>
|
||||
GroupWait = 4,
|
||||
/// <summary>
|
||||
/// The prepare-session update. Tells a user to load some content.
|
||||
/// </summary>
|
||||
PrepareSession = 5,
|
||||
/// <summary>
|
||||
/// The keep-alive update. An update to keep alive the socket.
|
||||
/// </summary>
|
||||
KeepAlive = 6,
|
||||
/// <summary>
|
||||
/// The not-in-group update. Tells a user that no group has been joined.
|
||||
/// </summary>
|
||||
NotInGroup = 7
|
||||
}
|
||||
}
|
||||
34
MediaBrowser.Model/Syncplay/SyncplayRequestInfo.cs
Normal file
34
MediaBrowser.Model/Syncplay/SyncplayRequestInfo.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using System;
|
||||
|
||||
namespace MediaBrowser.Model.Syncplay
|
||||
{
|
||||
/// <summary>
|
||||
/// Class SyncplayRequestInfo.
|
||||
/// </summary>
|
||||
public class SyncplayRequestInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the request type.
|
||||
/// </summary>
|
||||
/// <value>The request type.</value>
|
||||
public SyncplayRequestType Type;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets when the request has been made by the client.
|
||||
/// </summary>
|
||||
/// <value>The date of the request.</value>
|
||||
public DateTime? When { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the position ticks.
|
||||
/// </summary>
|
||||
/// <value>The position ticks.</value>
|
||||
public long? PositionTicks { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the ping time.
|
||||
/// </summary>
|
||||
/// <value>The ping time.</value>
|
||||
public long? Ping { get; set; }
|
||||
}
|
||||
}
|
||||
33
MediaBrowser.Model/Syncplay/SyncplayRequestType.cs
Normal file
33
MediaBrowser.Model/Syncplay/SyncplayRequestType.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
namespace MediaBrowser.Model.Syncplay
|
||||
{
|
||||
/// <summary>
|
||||
/// Enum SyncplayRequestType
|
||||
/// </summary>
|
||||
public enum SyncplayRequestType
|
||||
{
|
||||
/// <summary>
|
||||
/// A user is requesting a play command for the group.
|
||||
/// </summary>
|
||||
Play = 0,
|
||||
/// <summary>
|
||||
/// A user is requesting a pause command for the group.
|
||||
/// </summary>
|
||||
Pause = 1,
|
||||
/// <summary>
|
||||
/// A user is requesting a seek command for the group.
|
||||
/// </summary>
|
||||
Seek = 2,
|
||||
/// <summary>
|
||||
/// A user is signaling that playback is buffering.
|
||||
/// </summary>
|
||||
Buffering = 3,
|
||||
/// <summary>
|
||||
/// A user is signaling that playback resumed.
|
||||
/// </summary>
|
||||
BufferingComplete = 4,
|
||||
/// <summary>
|
||||
/// A user is reporting its ping.
|
||||
/// </summary>
|
||||
KeepAlive = 5
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user