mirror of https://github.com/jellyfin/jellyfin.git
Merge 1d65d4feff
into 5612cb8178
This commit is contained in:
commit
b87f1b9407
|
@ -62,6 +62,11 @@ namespace Emby.Server.Implementations.SyncPlay
|
|||
/// </summary>
|
||||
private IGroupState _state;
|
||||
|
||||
/// <summary>
|
||||
/// The internal playback speed.
|
||||
/// </summary>
|
||||
private float? _playbackSpeed = 1.0f;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Group" /> class.
|
||||
/// </summary>
|
||||
|
@ -138,6 +143,16 @@ namespace Emby.Server.Implementations.SyncPlay
|
|||
/// <value>The last activity.</value>
|
||||
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>
|
||||
/// Adds the session to the group.
|
||||
/// </summary>
|
||||
|
@ -679,7 +694,8 @@ namespace Emby.Server.Implementations.SyncPlay
|
|||
startPositionTicks,
|
||||
isPlaying,
|
||||
PlayQueue.ShuffleMode,
|
||||
PlayQueue.RepeatMode);
|
||||
PlayQueue.RepeatMode,
|
||||
PlaybackSpeed);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,6 +11,8 @@ namespace MediaBrowser.Model.Session
|
|||
/// </summary>
|
||||
public class PlaybackProgressInfo
|
||||
{
|
||||
private float? _playbackSpeed = 1.0f;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether this instance can seek.
|
||||
/// </summary>
|
||||
|
@ -116,5 +118,15 @@ namespace MediaBrowser.Model.Session
|
|||
public QueueItem[] NowPlayingQueue { 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
|
||||
#pragma warning disable CS1591
|
||||
|
||||
using System;
|
||||
|
||||
namespace MediaBrowser.Model.Session
|
||||
{
|
||||
public class PlayerStateInfo
|
||||
{
|
||||
private float? _playbackSpeed = 1.0f;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the now playing position ticks.
|
||||
/// </summary>
|
||||
|
@ -76,5 +80,15 @@ namespace MediaBrowser.Model.Session
|
|||
/// </summary>
|
||||
/// <value>The live stream identifier.</value>
|
||||
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="shuffleMode">The shuffle 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;
|
||||
LastUpdate = lastUpdate;
|
||||
|
@ -29,6 +30,7 @@ namespace MediaBrowser.Model.SyncPlay
|
|||
IsPlaying = isPlaying;
|
||||
ShuffleMode = shuffleMode;
|
||||
RepeatMode = repeatMode;
|
||||
PlaybackSpeed = playbackSpeed is null ? null : (float?)Math.Round(Math.Clamp(playbackSpeed.Value, 0.1f, 10.0f), 1);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -78,5 +80,11 @@ namespace MediaBrowser.Model.SyncPlay
|
|||
/// </summary>
|
||||
/// <value>The repeat mode.</value>
|
||||
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>
|
||||
/// A user is changing shuffle mode.
|
||||
/// </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>
|
||||
/// A user is requesting to be ignored on group wait.
|
||||
/// </summary>
|
||||
IgnoreWait = 16
|
||||
IgnoreWait = 16,
|
||||
|
||||
/// <summary>
|
||||
/// A user is requesting to change the playback speed.
|
||||
/// </summary>
|
||||
SetPlaybackSpeed = 17
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue