diff options
Diffstat (limited to 'MediaBrowser.Api/Playback/Progressive')
3 files changed, 40 insertions, 8 deletions
diff --git a/MediaBrowser.Api/Playback/Progressive/AudioService.cs b/MediaBrowser.Api/Playback/Progressive/AudioService.cs index dcb7d96e30..850e8ff3b4 100644 --- a/MediaBrowser.Api/Playback/Progressive/AudioService.cs +++ b/MediaBrowser.Api/Playback/Progressive/AudioService.cs @@ -7,12 +7,12 @@ namespace MediaBrowser.Api.Playback.Progressive /// <summary> /// Class GetAudioStream /// </summary> - [Route("/Audio/{Id}.mp3", "GET")] - [Route("/Audio/{Id}.wma", "GET")] - [Route("/Audio/{Id}.aac", "GET")] - [Route("/Audio/{Id}.flac", "GET")] - [Route("/Audio/{Id}.ogg", "GET")] - [Route("/Audio/{Id}", "GET")] + [Route("/Audio/{Id}/stream.mp3", "GET")] + [Route("/Audio/{Id}/stream.wma", "GET")] + [Route("/Audio/{Id}/stream.aac", "GET")] + [Route("/Audio/{Id}/stream.flac", "GET")] + [Route("/Audio/{Id}/stream.ogg", "GET")] + [Route("/Audio/{Id}/stream", "GET")] public class GetAudioStream : StreamRequest { diff --git a/MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs b/MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs index bc2d26bcc0..62ca74df92 100644 --- a/MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs +++ b/MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs @@ -1,4 +1,5 @@ -using MediaBrowser.Controller; +using MediaBrowser.Common.Net; +using MediaBrowser.Controller; using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Entities.Audio; using MediaBrowser.Model.Dto; @@ -123,6 +124,8 @@ namespace MediaBrowser.Api.Playback.Progressive // Use the command line args with a dummy playlist path var outputPath = GetOutputFilePath(state); + Response.ContentType = MimeTypes.GetMimeType(outputPath); + if (!File.Exists(outputPath)) { await StartFFMpeg(state, outputPath).ConfigureAwait(false); diff --git a/MediaBrowser.Api/Playback/Progressive/VideoService.cs b/MediaBrowser.Api/Playback/Progressive/VideoService.cs index b43b4bfbcb..cb02518d1f 100644 --- a/MediaBrowser.Api/Playback/Progressive/VideoService.cs +++ b/MediaBrowser.Api/Playback/Progressive/VideoService.cs @@ -1,11 +1,30 @@ using MediaBrowser.Controller; using MediaBrowser.Controller.Entities; -using MediaBrowser.Model.Logging; using System; +using ServiceStack.ServiceHost; namespace MediaBrowser.Api.Playback.Progressive { /// <summary> + /// Class GetAudioStream + /// </summary> + [Route("/Videos/{Id}/stream.ts", "GET")] + [Route("/Videos/{Id}/stream.webm", "GET")] + [Route("/Videos/{Id}/stream.asf", "GET")] + [Route("/Videos/{Id}/stream.wmv", "GET")] + [Route("/Videos/{Id}/stream.ogv", "GET")] + [Route("/Videos/{Id}/stream.mp4", "GET")] + [Route("/Videos/{Id}/stream.m4v", "GET")] + [Route("/Videos/{Id}/stream.mkv", "GET")] + [Route("/Videos/{Id}/stream.mpeg", "GET")] + [Route("/Videos/{Id}/stream.avi", "GET")] + [Route("/Videos/{Id}/stream", "GET")] + public class GetVideoStream : StreamRequest + { + + } + + /// <summary> /// Class VideoService /// </summary> public class VideoService : BaseProgressiveStreamingService @@ -20,6 +39,16 @@ namespace MediaBrowser.Api.Playback.Progressive } /// <summary> + /// Gets the specified request. + /// </summary> + /// <param name="request">The request.</param> + /// <returns>System.Object.</returns> + public object Get(GetVideoStream request) + { + return ProcessRequest(request); + } + + /// <summary> /// Gets the command line arguments. /// </summary> /// <param name="outputPath">The output path.</param> |
