diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-04-06 13:53:23 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-04-06 13:53:23 -0400 |
| commit | c60103df64104459883f1244363cc9cd39187545 (patch) | |
| tree | 9c2d90fb6b59905a265ffd3f10a036d3e50ce487 /MediaBrowser.Server.Implementations/Session/SessionWebSocketListener.cs | |
| parent | 241c43e9a1f9ad2fbc940626f9c85c469402bc55 (diff) | |
chromecast updates
Diffstat (limited to 'MediaBrowser.Server.Implementations/Session/SessionWebSocketListener.cs')
| -rw-r--r-- | MediaBrowser.Server.Implementations/Session/SessionWebSocketListener.cs | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/MediaBrowser.Server.Implementations/Session/SessionWebSocketListener.cs b/MediaBrowser.Server.Implementations/Session/SessionWebSocketListener.cs index fe32e2328..0ed94db8c 100644 --- a/MediaBrowser.Server.Implementations/Session/SessionWebSocketListener.cs +++ b/MediaBrowser.Server.Implementations/Session/SessionWebSocketListener.cs @@ -1,4 +1,5 @@ -using MediaBrowser.Common.Net; +using System.Globalization; +using MediaBrowser.Common.Net; using MediaBrowser.Controller; using MediaBrowser.Controller.Dto; using MediaBrowser.Controller.Session; @@ -187,6 +188,8 @@ namespace MediaBrowser.Server.Implementations.Session return result; } + private readonly CultureInfo _usCulture = new CultureInfo("en-US"); + /// <summary> /// Reports the playback start. /// </summary> @@ -228,6 +231,16 @@ namespace MediaBrowser.Server.Implementations.Session info.MediaSourceId = vals[3]; } + if (vals.Length > 4 && !string.IsNullOrWhiteSpace(vals[4])) + { + info.AudioStreamIndex = int.Parse(vals[4], _usCulture); + } + + if (vals.Length > 5 && !string.IsNullOrWhiteSpace(vals[5])) + { + info.SubtitleStreamIndex = int.Parse(vals[5], _usCulture); + } + _sessionManager.OnPlaybackStart(info); } } @@ -275,6 +288,21 @@ namespace MediaBrowser.Server.Implementations.Session info.MediaSourceId = vals[4]; } + if (vals.Length > 5 && !string.IsNullOrWhiteSpace(vals[5])) + { + info.VolumeLevel = int.Parse(vals[5], _usCulture); + } + + if (vals.Length > 5 && !string.IsNullOrWhiteSpace(vals[6])) + { + info.AudioStreamIndex = int.Parse(vals[6], _usCulture); + } + + if (vals.Length > 7 && !string.IsNullOrWhiteSpace(vals[7])) + { + info.SubtitleStreamIndex = int.Parse(vals[7], _usCulture); + } + _sessionManager.OnPlaybackProgress(info); } } |
