Add PlaybackSpeed properties to state APIS

This commit is contained in:
rzk3 2023-02-16 09:18:26 -05:00
parent 65f6c2e2fd
commit 7c46947df5
2 changed files with 50 additions and 0 deletions

View File

@ -11,6 +11,8 @@ namespace MediaBrowser.Model.Session
/// </summary>
public class PlaybackProgressInfo
{
private double _playbackSpeed = 1.0;
/// <summary>
/// Gets or sets a value indicating whether this instance can seek.
/// </summary>
@ -110,5 +112,27 @@ 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 double PlaybackSpeed
{
get
{
return _playbackSpeed;
}
set
{
if (value > 10 || value < 0.1)
{
throw new InvalidOperationException("PlaybackSpeed must be between 0.1 and 10.0");
}
_playbackSpeed = value;
}
}
}
}

View File

@ -1,10 +1,14 @@
#nullable disable
#pragma warning disable CS1591
using System;
namespace MediaBrowser.Model.Session
{
public class PlayerStateInfo
{
private double _playbackSpeed = 1.0;
/// <summary>
/// Gets or sets the now playing position ticks.
/// </summary>
@ -70,5 +74,27 @@ 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 double PlaybackSpeed
{
get
{
return _playbackSpeed;
}
set
{
if (value > 10 || value < 0.1)
{
throw new InvalidOperationException("PlaybackSpeed must be between 0.1 and 10.0");
}
_playbackSpeed = value;
}
}
}
}