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> /// </summary>
public class PlaybackProgressInfo public class PlaybackProgressInfo
{ {
private double _playbackSpeed = 1.0;
/// <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>
@ -110,5 +112,27 @@ 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 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 #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 double _playbackSpeed = 1.0;
/// <summary> /// <summary>
/// Gets or sets the now playing position ticks. /// Gets or sets the now playing position ticks.
/// </summary> /// </summary>
@ -70,5 +74,27 @@ 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 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;
}
}
} }
} }