diff options
| author | Tim Hobbs <jesus.tesh@gmail.com> | 2014-04-06 11:01:26 -0700 |
|---|---|---|
| committer | Tim Hobbs <jesus.tesh@gmail.com> | 2014-04-06 11:01:26 -0700 |
| commit | 631bba1d3cbcd2e8dc9c84c23d89b910dc8e0113 (patch) | |
| tree | 3ff1455a7dbf551e5752b3c88f9adb3bc9554644 /MediaBrowser.Server.Implementations/Session/SessionWebSocketListener.cs | |
| parent | 0f88830fd98173815da097c54e5d8d5281dbffd5 (diff) | |
| parent | c60103df64104459883f1244363cc9cd39187545 (diff) | |
Merge remote-tracking branch 'upstream/master'
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); } } |
