diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2013-05-01 16:07:20 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2013-05-01 16:07:20 -0400 |
| commit | e9cfa6cd267786f8fd97ef2aeb88941c98c8aacf (patch) | |
| tree | 71cbe29e9783c901985f2b8851011debc60db586 /MediaBrowser.Api/Playback/BaseStreamingService.cs | |
| parent | f9ec1ce37f3a87fc5845a9a12282a444858fd3f0 (diff) | |
add remote streaming capabilities
Diffstat (limited to 'MediaBrowser.Api/Playback/BaseStreamingService.cs')
| -rw-r--r-- | MediaBrowser.Api/Playback/BaseStreamingService.cs | 38 |
1 files changed, 35 insertions, 3 deletions
diff --git a/MediaBrowser.Api/Playback/BaseStreamingService.cs b/MediaBrowser.Api/Playback/BaseStreamingService.cs index 30700ad4c..f09b9f684 100644 --- a/MediaBrowser.Api/Playback/BaseStreamingService.cs +++ b/MediaBrowser.Api/Playback/BaseStreamingService.cs @@ -166,6 +166,11 @@ namespace MediaBrowser.Api.Playback { var args = string.Empty; + if (state.Item.LocationType == LocationType.Remote) + { + return string.Empty; + } + if (state.VideoStream != null) { args += string.Format("-map 0:{0}", state.VideoStream.Index); @@ -179,6 +184,7 @@ namespace MediaBrowser.Api.Playback { args += string.Format(" -map 0:{0}", state.AudioStream.Index); } + else { args += " -map -0:a"; @@ -268,8 +274,20 @@ namespace MediaBrowser.Api.Playback // Need to perform calculations manually // Try to account for bad media info - var currentHeight = state.VideoStream.Height ?? request.MaxHeight ?? request.Height ?? 0; - var currentWidth = state.VideoStream.Width ?? request.MaxWidth ?? request.Width ?? 0; + var currentHeight = request.MaxHeight ?? request.Height ?? 0; + var currentWidth = request.MaxWidth ?? request.Width ?? 0; + + if (state.VideoStream != null) + { + if (state.VideoStream.Height.HasValue) + { + currentHeight = state.VideoStream.Height.Value; + } + if (state.VideoStream.Width.HasValue) + { + currentWidth = state.VideoStream.Width.Value; + } + } var outputSize = DrawingUtils.Resize(currentWidth, currentHeight, request.Width, request.Height, request.MaxWidth, request.MaxHeight); @@ -604,6 +622,21 @@ namespace MediaBrowser.Api.Playback } /// <summary> + /// Gets the user agent param. + /// </summary> + /// <param name="item">The item.</param> + /// <returns>System.String.</returns> + protected string GetUserAgentParam(BaseItem item) + { + if (item.Path.IndexOf("apple.com", StringComparison.OrdinalIgnoreCase) != -1) + { + return "-user-agent \"QuickTime/7.6.2\""; + } + + return string.Empty; + } + + /// <summary> /// Processes the exited. /// </summary> /// <param name="process">The process.</param> @@ -704,7 +737,6 @@ namespace MediaBrowser.Api.Playback state.AudioStream = GetMediaStream(media.MediaStreams, null, MediaStreamType.Audio, true); } - return state; } |
