aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/Session/SessionWebSocketListener.cs
diff options
context:
space:
mode:
authortikuf <admin@nyalindee.com>2014-04-07 12:43:29 +1000
committertikuf <admin@nyalindee.com>2014-04-07 12:43:29 +1000
commit8ae71b75fb024815e165eba9b3d00ca8307caab3 (patch)
tree54274881bca0834c2ab518c51bc65160fc320db1 /MediaBrowser.Server.Implementations/Session/SessionWebSocketListener.cs
parent161e1af0eaa69e828f64d33311e3bc462852d6c4 (diff)
parent56c0d491f4c05a2c0c4f21c20e3530c039b33148 (diff)
Merge branch 'master' of https://github.com/MediaBrowser/MediaBrowser
Diffstat (limited to 'MediaBrowser.Server.Implementations/Session/SessionWebSocketListener.cs')
-rw-r--r--MediaBrowser.Server.Implementations/Session/SessionWebSocketListener.cs30
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);
}
}