diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2013-08-29 17:00:27 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2013-08-29 17:00:27 -0400 |
| commit | 982a30394018a9262aae0fafc56c736635ba27ed (patch) | |
| tree | 41e942f3df0b6cbae9a677bb3edbb4d43af40e9a /MediaBrowser.Server.Implementations/Session | |
| parent | 528292e496ef1cb6e226937f09774e57996d03db (diff) | |
added IsMuted to playback progress
Diffstat (limited to 'MediaBrowser.Server.Implementations/Session')
| -rw-r--r-- | MediaBrowser.Server.Implementations/Session/SessionManager.cs | 11 | ||||
| -rw-r--r-- | MediaBrowser.Server.Implementations/Session/SessionWebSocketListener.cs | 3 |
2 files changed, 8 insertions, 6 deletions
diff --git a/MediaBrowser.Server.Implementations/Session/SessionManager.cs b/MediaBrowser.Server.Implementations/Session/SessionManager.cs index 697e13517..4ba0a22ee 100644 --- a/MediaBrowser.Server.Implementations/Session/SessionManager.cs +++ b/MediaBrowser.Server.Implementations/Session/SessionManager.cs @@ -159,8 +159,9 @@ namespace MediaBrowser.Server.Implementations.Session /// <param name="item">The item.</param> /// <param name="isPaused">if set to <c>true</c> [is paused].</param> /// <param name="currentPositionTicks">The current position ticks.</param> - private void UpdateNowPlayingItem(SessionInfo session, BaseItem item, bool isPaused, long? currentPositionTicks = null) + private void UpdateNowPlayingItem(SessionInfo session, BaseItem item, bool isPaused, bool isMuted, long? currentPositionTicks = null) { + session.IsMuted = isMuted; session.IsPaused = isPaused; session.NowPlayingPositionTicks = currentPositionTicks; session.NowPlayingItem = item; @@ -178,7 +179,7 @@ namespace MediaBrowser.Server.Implementations.Session { session.NowPlayingItem = null; session.NowPlayingPositionTicks = null; - session.IsPaused = null; + session.IsPaused = false; } } @@ -225,7 +226,7 @@ namespace MediaBrowser.Server.Implementations.Session var session = Sessions.First(i => i.Id.Equals(sessionId)); - UpdateNowPlayingItem(session, item, false); + UpdateNowPlayingItem(session, item, false, false); var key = item.GetUserDataKey(); @@ -262,7 +263,7 @@ namespace MediaBrowser.Server.Implementations.Session /// <returns>Task.</returns> /// <exception cref="System.ArgumentNullException"></exception> /// <exception cref="System.ArgumentOutOfRangeException">positionTicks</exception> - public async Task OnPlaybackProgress(BaseItem item, long? positionTicks, bool isPaused, Guid sessionId) + public async Task OnPlaybackProgress(BaseItem item, long? positionTicks, bool isPaused, bool isMuted, Guid sessionId) { if (item == null) { @@ -276,7 +277,7 @@ namespace MediaBrowser.Server.Implementations.Session var session = Sessions.First(i => i.Id.Equals(sessionId)); - UpdateNowPlayingItem(session, item, isPaused, positionTicks); + UpdateNowPlayingItem(session, item, isPaused, isMuted, positionTicks); var key = item.GetUserDataKey(); diff --git a/MediaBrowser.Server.Implementations/Session/SessionWebSocketListener.cs b/MediaBrowser.Server.Implementations/Session/SessionWebSocketListener.cs index 40c06fdf2..893a6e49e 100644 --- a/MediaBrowser.Server.Implementations/Session/SessionWebSocketListener.cs +++ b/MediaBrowser.Server.Implementations/Session/SessionWebSocketListener.cs @@ -137,8 +137,9 @@ namespace MediaBrowser.Server.Implementations.Session } var isPaused = vals.Length > 2 && string.Equals(vals[2], "true", StringComparison.OrdinalIgnoreCase); + var isMuted = vals.Length > 3 && string.Equals(vals[3], "true", StringComparison.OrdinalIgnoreCase); - _sessionManager.OnPlaybackProgress(item, positionTicks, isPaused, session.Id); + _sessionManager.OnPlaybackProgress(item, positionTicks, isPaused, isMuted, session.Id); } } else if (string.Equals(message.MessageType, "PlaybackStopped", StringComparison.OrdinalIgnoreCase)) |
