mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-08-07 06:37:09 +02:00
Merge 1d65d4feff
into 5cae44fdf7
This commit is contained in:
commit
478ffba446
@ -62,6 +62,11 @@ namespace Emby.Server.Implementations.SyncPlay
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private IGroupState _state;
|
private IGroupState _state;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The internal playback speed.
|
||||||
|
/// </summary>
|
||||||
|
private float? _playbackSpeed = 1.0f;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="Group" /> class.
|
/// Initializes a new instance of the <see cref="Group" /> class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -138,6 +143,16 @@ namespace Emby.Server.Implementations.SyncPlay
|
|||||||
/// <value>The last activity.</value>
|
/// <value>The last activity.</value>
|
||||||
public DateTime LastActivity { get; set; }
|
public DateTime LastActivity { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the playback speed.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>The playback speed.</value>
|
||||||
|
public float? PlaybackSpeed
|
||||||
|
{
|
||||||
|
get => _playbackSpeed;
|
||||||
|
set => _playbackSpeed = value is null ? null : (float?)Math.Round(Math.Clamp(value.Value, 0.1f, 10.0f), 1);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Adds the session to the group.
|
/// Adds the session to the group.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -673,7 +688,8 @@ namespace Emby.Server.Implementations.SyncPlay
|
|||||||
startPositionTicks,
|
startPositionTicks,
|
||||||
isPlaying,
|
isPlaying,
|
||||||
PlayQueue.ShuffleMode,
|
PlayQueue.ShuffleMode,
|
||||||
PlayQueue.RepeatMode);
|
PlayQueue.RepeatMode,
|
||||||
|
PlaybackSpeed);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,6 +11,8 @@ namespace MediaBrowser.Model.Session
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public class PlaybackProgressInfo
|
public class PlaybackProgressInfo
|
||||||
{
|
{
|
||||||
|
private float? _playbackSpeed = 1.0f;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets a value indicating whether this instance can seek.
|
/// Gets or sets a value indicating whether this instance can seek.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -116,5 +118,15 @@ namespace MediaBrowser.Model.Session
|
|||||||
public QueueItem[] NowPlayingQueue { get; set; }
|
public QueueItem[] NowPlayingQueue { get; set; }
|
||||||
|
|
||||||
public string PlaylistItemId { get; set; }
|
public string PlaylistItemId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the playback speed.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>The playback speed.</value>
|
||||||
|
public float? PlaybackSpeed
|
||||||
|
{
|
||||||
|
get => _playbackSpeed;
|
||||||
|
set => _playbackSpeed = value is null ? null : (float?)Math.Round(Math.Clamp(value.Value, 0.1f, 10.0f), 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,14 @@
|
|||||||
#nullable disable
|
#nullable disable
|
||||||
#pragma warning disable CS1591
|
#pragma warning disable CS1591
|
||||||
|
|
||||||
|
using System;
|
||||||
|
|
||||||
namespace MediaBrowser.Model.Session
|
namespace MediaBrowser.Model.Session
|
||||||
{
|
{
|
||||||
public class PlayerStateInfo
|
public class PlayerStateInfo
|
||||||
{
|
{
|
||||||
|
private float? _playbackSpeed = 1.0f;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the now playing position ticks.
|
/// Gets or sets the now playing position ticks.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -76,5 +80,15 @@ namespace MediaBrowser.Model.Session
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>The live stream identifier.</value>
|
/// <value>The live stream identifier.</value>
|
||||||
public string LiveStreamId { get; set; }
|
public string LiveStreamId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the playback speed.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>The playback speed.</value>
|
||||||
|
public float? PlaybackSpeed
|
||||||
|
{
|
||||||
|
get => _playbackSpeed;
|
||||||
|
set => _playbackSpeed = value is null ? null : (float?)Math.Round(Math.Clamp(value.Value, 0.1f, 10.0f), 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,8 @@ namespace MediaBrowser.Model.SyncPlay
|
|||||||
/// <param name="isPlaying">The playing item status.</param>
|
/// <param name="isPlaying">The playing item status.</param>
|
||||||
/// <param name="shuffleMode">The shuffle mode.</param>
|
/// <param name="shuffleMode">The shuffle mode.</param>
|
||||||
/// <param name="repeatMode">The repeat mode.</param>
|
/// <param name="repeatMode">The repeat mode.</param>
|
||||||
public PlayQueueUpdate(PlayQueueUpdateReason reason, DateTime lastUpdate, IReadOnlyList<SyncPlayQueueItem> playlist, int playingItemIndex, long startPositionTicks, bool isPlaying, GroupShuffleMode shuffleMode, GroupRepeatMode repeatMode)
|
/// <param name="playbackSpeed">The playback speed.</param>
|
||||||
|
public PlayQueueUpdate(PlayQueueUpdateReason reason, DateTime lastUpdate, IReadOnlyList<SyncPlayQueueItem> playlist, int playingItemIndex, long startPositionTicks, bool isPlaying, GroupShuffleMode shuffleMode, GroupRepeatMode repeatMode, float? playbackSpeed)
|
||||||
{
|
{
|
||||||
Reason = reason;
|
Reason = reason;
|
||||||
LastUpdate = lastUpdate;
|
LastUpdate = lastUpdate;
|
||||||
@ -29,6 +30,7 @@ namespace MediaBrowser.Model.SyncPlay
|
|||||||
IsPlaying = isPlaying;
|
IsPlaying = isPlaying;
|
||||||
ShuffleMode = shuffleMode;
|
ShuffleMode = shuffleMode;
|
||||||
RepeatMode = repeatMode;
|
RepeatMode = repeatMode;
|
||||||
|
PlaybackSpeed = playbackSpeed is null ? null : (float?)Math.Round(Math.Clamp(playbackSpeed.Value, 0.1f, 10.0f), 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -78,5 +80,11 @@ namespace MediaBrowser.Model.SyncPlay
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>The repeat mode.</value>
|
/// <value>The repeat mode.</value>
|
||||||
public GroupRepeatMode RepeatMode { get; }
|
public GroupRepeatMode RepeatMode { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the PlaybackSpeed.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>The playback speed.</value>
|
||||||
|
public float? PlaybackSpeed { get; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -53,6 +53,11 @@ namespace MediaBrowser.Model.SyncPlay
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A user is changing shuffle mode.
|
/// A user is changing shuffle mode.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
ShuffleMode = 9
|
ShuffleMode = 9,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// A user has changed the playback speed.
|
||||||
|
/// </summary>
|
||||||
|
PlaybackSpeedChange = 10
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -88,6 +88,11 @@ namespace MediaBrowser.Model.SyncPlay
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A user is requesting to be ignored on group wait.
|
/// A user is requesting to be ignored on group wait.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
IgnoreWait = 16
|
IgnoreWait = 16,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// A user is requesting to change the playback speed.
|
||||||
|
/// </summary>
|
||||||
|
SetPlaybackSpeed = 17
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user