diff --git a/MediaBrowser.Api/Playback/MediaInfoService.cs b/MediaBrowser.Api/Playback/MediaInfoService.cs index ca735f068..46a1ff789 100644 --- a/MediaBrowser.Api/Playback/MediaInfoService.cs +++ b/MediaBrowser.Api/Playback/MediaInfoService.cs @@ -101,7 +101,7 @@ namespace MediaBrowser.Api.Playback SetDeviceSpecificData(item, result.MediaSource, profile, authInfo, request.MaxStreamingBitrate, request.StartTimeTicks ?? 0, result.MediaSource.Id, request.AudioStreamIndex, - request.SubtitleStreamIndex); + request.SubtitleStreamIndex, request.PlaySessionId); } else { @@ -206,7 +206,7 @@ namespace MediaBrowser.Api.Playback foreach (var mediaSource in result.MediaSources) { - SetDeviceSpecificData(item, mediaSource, profile, auth, maxBitrate, startTimeTicks, mediaSourceId, audioStreamIndex, subtitleStreamIndex); + SetDeviceSpecificData(item, mediaSource, profile, auth, maxBitrate, startTimeTicks, mediaSourceId, audioStreamIndex, subtitleStreamIndex, result.PlaySessionId); } SortMediaSources(result); @@ -220,7 +220,8 @@ namespace MediaBrowser.Api.Playback long startTimeTicks, string mediaSourceId, int? audioStreamIndex, - int? subtitleStreamIndex) + int? subtitleStreamIndex, + string playSessionId) { var streamBuilder = new StreamBuilder(); @@ -294,6 +295,12 @@ namespace MediaBrowser.Api.Playback streamBuilder.BuildAudioItem(options) : streamBuilder.BuildVideoItem(options); + if (streamInfo != null) + { + streamInfo.PlaySessionId = playSessionId; + SetDeviceSpecificSubtitleInfo(streamInfo, mediaSource, baseUrl, auth.Token); + } + if (streamInfo != null && streamInfo.PlayMethod == PlayMethod.Transcode) { streamInfo.StartPositionTicks = startTimeTicks; @@ -301,11 +308,6 @@ namespace MediaBrowser.Api.Playback mediaSource.TranscodingContainer = streamInfo.Container; mediaSource.TranscodingSubProtocol = streamInfo.SubProtocol; } - - if (streamInfo != null) - { - SetDeviceSpecificSubtitleInfo(streamInfo, mediaSource, baseUrl, auth.Token); - } } } diff --git a/MediaBrowser.Model/Dlna/StreamInfo.cs b/MediaBrowser.Model/Dlna/StreamInfo.cs index 3977a9ab0..a2f5fcb10 100644 --- a/MediaBrowser.Model/Dlna/StreamInfo.cs +++ b/MediaBrowser.Model/Dlna/StreamInfo.cs @@ -69,7 +69,7 @@ namespace MediaBrowser.Model.Dlna public SubtitleDeliveryMethod SubtitleDeliveryMethod { get; set; } public string SubtitleFormat { get; set; } - public PlaybackInfoResponse PlaybackInfo { get; set; } + public string PlaySessionId { get; set; } public string MediaSourceId { @@ -207,8 +207,7 @@ namespace MediaBrowser.Model.Dlna list.Add(new NameValuePair("Profile", item.VideoProfile ?? string.Empty)); list.Add(new NameValuePair("Cabac", item.Cabac.HasValue ? item.Cabac.Value.ToString() : string.Empty)); - string playSessionId = item.PlaybackInfo == null ? null : item.PlaybackInfo.PlaySessionId; - list.Add(new NameValuePair("PlaySessionId", playSessionId ?? string.Empty)); + list.Add(new NameValuePair("PlaySessionId", item.PlaySessionId ?? string.Empty)); list.Add(new NameValuePair("api_key", accessToken ?? string.Empty)); string liveStreamId = item.MediaSource == null ? null : item.MediaSource.LiveStreamId; @@ -217,6 +216,11 @@ namespace MediaBrowser.Model.Dlna return list; } + public List GetExternalSubtitles(bool includeSelectedTrackOnly, string baseUrl, string accessToken) + { + return GetExternalSubtitles(includeSelectedTrackOnly, false, baseUrl, accessToken); + } + public List GetExternalSubtitles(bool includeSelectedTrackOnly, bool enableAllProfiles, string baseUrl, string accessToken) { List list = GetSubtitleProfiles(includeSelectedTrackOnly, enableAllProfiles, baseUrl, accessToken); diff --git a/MediaBrowser.Model/MediaInfo/LiveStreamRequest.cs b/MediaBrowser.Model/MediaInfo/LiveStreamRequest.cs index 563006a4d..3affbbcc3 100644 --- a/MediaBrowser.Model/MediaInfo/LiveStreamRequest.cs +++ b/MediaBrowser.Model/MediaInfo/LiveStreamRequest.cs @@ -6,6 +6,7 @@ namespace MediaBrowser.Model.MediaInfo { public string OpenToken { get; set; } public string UserId { get; set; } + public string PlaySessionId { get; set; } public int? MaxStreamingBitrate { get; set; } public long? StartTimeTicks { get; set; } public int? AudioStreamIndex { get; set; } @@ -15,7 +16,7 @@ namespace MediaBrowser.Model.MediaInfo public LiveStreamRequest() { - + } public LiveStreamRequest(AudioOptions options) diff --git a/MediaBrowser.Model/Session/PlaybackProgressInfo.cs b/MediaBrowser.Model/Session/PlaybackProgressInfo.cs index a029df4a9..a7ca09c15 100644 --- a/MediaBrowser.Model/Session/PlaybackProgressInfo.cs +++ b/MediaBrowser.Model/Session/PlaybackProgressInfo.cs @@ -83,5 +83,10 @@ namespace MediaBrowser.Model.Session /// /// The live stream identifier. public string LiveStreamId { get; set; } + /// + /// Gets or sets the play session identifier. + /// + /// The play session identifier. + public string PlaySessionId { get; set; } } } \ No newline at end of file diff --git a/MediaBrowser.Model/Session/PlaybackStopInfo.cs b/MediaBrowser.Model/Session/PlaybackStopInfo.cs index a3bdc9a96..80d719f03 100644 --- a/MediaBrowser.Model/Session/PlaybackStopInfo.cs +++ b/MediaBrowser.Model/Session/PlaybackStopInfo.cs @@ -41,5 +41,10 @@ namespace MediaBrowser.Model.Session /// /// The live stream identifier. public string LiveStreamId { get; set; } + /// + /// Gets or sets the play session identifier. + /// + /// The play session identifier. + public string PlaySessionId { get; set; } } } \ No newline at end of file