diff options
| author | LogicalPhallacy <44458166+LogicalPhallacy@users.noreply.github.com> | 2019-10-28 21:54:40 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-10-28 21:54:40 -0700 |
| commit | 8edb1c49d8d1835566bd30d8bf5460ab707b1ede (patch) | |
| tree | 03c6b38523efcc4f29691cea3cdc4def0e8d26d8 /MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs | |
| parent | 984e415c66cbd995d12ea95a3a9d3e2561ce4869 (diff) | |
| parent | c9f4a74af02e08b895cd6a8b8a408b1c0edfb6c4 (diff) | |
Merge pull request #6 from jellyfin/master
Bringing my branch up to sync
Diffstat (limited to 'MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs')
| -rw-r--r-- | MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs b/MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs index 83a3f3e3c..97c1a7a49 100644 --- a/MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs +++ b/MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs @@ -77,7 +77,8 @@ namespace MediaBrowser.Api.Playback.Progressive { var videoCodec = state.VideoRequest.VideoCodec; - if (string.Equals(videoCodec, "h264", StringComparison.OrdinalIgnoreCase)) + if (string.Equals(videoCodec, "h264", StringComparison.OrdinalIgnoreCase) || + string.Equals(videoCodec, "h265", StringComparison.OrdinalIgnoreCase)) { return ".ts"; } @@ -279,18 +280,24 @@ namespace MediaBrowser.Api.Playback.Progressive /// <param name="isHeadRequest">if set to <c>true</c> [is head request].</param> /// <param name="cancellationTokenSource">The cancellation token source.</param> /// <returns>Task{System.Object}.</returns> - private async Task<object> GetStaticRemoteStreamResult(StreamState state, Dictionary<string, string> responseHeaders, bool isHeadRequest, CancellationTokenSource cancellationTokenSource) + private async Task<object> GetStaticRemoteStreamResult( + StreamState state, + Dictionary<string, string> responseHeaders, + bool isHeadRequest, + CancellationTokenSource cancellationTokenSource) { - state.RemoteHttpHeaders.TryGetValue(HeaderNames.UserAgent, out var useragent); - var options = new HttpRequestOptions { Url = state.MediaPath, - UserAgent = useragent, BufferContent = false, CancellationToken = cancellationTokenSource.Token }; + if (state.RemoteHttpHeaders.TryGetValue(HeaderNames.UserAgent, out var useragent)) + { + options.UserAgent = useragent; + } + var response = await HttpClient.GetResponse(options).ConfigureAwait(false); responseHeaders[HeaderNames.AcceptRanges] = "none"; @@ -305,7 +312,7 @@ namespace MediaBrowser.Api.Playback.Progressive { using (response) { - return ResultFactory.GetResult(null, new byte[] { }, response.ContentType, responseHeaders); + return ResultFactory.GetResult(null, Array.Empty<byte>(), response.ContentType, responseHeaders); } } |
