diff options
| author | LukePulverenti <luke.pulverenti@gmail.com> | 2013-03-09 01:13:10 -0500 |
|---|---|---|
| committer | LukePulverenti <luke.pulverenti@gmail.com> | 2013-03-09 01:13:10 -0500 |
| commit | 0a2b0ffba8848080d4cac824d3f44e2f12d8e20a (patch) | |
| tree | cbff2490dfb404048cee5c3642842dfb66fd3789 | |
| parent | 9b3a97edfc1d37de37986b4bdac3263c9367bf8f (diff) | |
progress on hls video. but not ready yet
| -rw-r--r-- | MediaBrowser.Api/Playback/Hls/VideoHlsService.cs | 39 |
1 files changed, 38 insertions, 1 deletions
diff --git a/MediaBrowser.Api/Playback/Hls/VideoHlsService.cs b/MediaBrowser.Api/Playback/Hls/VideoHlsService.cs index 39e1ca9d0..dfbed538f 100644 --- a/MediaBrowser.Api/Playback/Hls/VideoHlsService.cs +++ b/MediaBrowser.Api/Playback/Hls/VideoHlsService.cs @@ -1,10 +1,28 @@ -using MediaBrowser.Common.IO; +using System.IO; +using MediaBrowser.Common.IO; using MediaBrowser.Controller; using MediaBrowser.Controller.Library; using System; +using ServiceStack.ServiceHost; namespace MediaBrowser.Api.Playback.Hls { + [Route("/Videos/{Id}/stream.m3u8", "GET")] + [ServiceStack.ServiceHost.Api(Description = "Gets a video stream using HTTP live streaming.")] + public class GetHlsVideoStream : VideoStreamRequest + { + + } + + [Route("/Videos/{Id}/segments/{SegmentId}.ts", "GET")] + [ServiceStack.ServiceHost.Api(Description = "Gets an Http live streaming segment file. Internal use only.")] + public class GetHlsVideoSegment + { + public string Id { get; set; } + + public string SegmentId { get; set; } + } + public class VideoHlsService : BaseHlsService { public VideoHlsService(IServerApplicationPaths appPaths, IUserManager userManager, ILibraryManager libraryManager, IIsoManager isoManager) @@ -12,6 +30,25 @@ namespace MediaBrowser.Api.Playback.Hls { } + public object Get(GetHlsVideoSegment request) + { + var file = SegmentFilePrefix + request.SegmentId + Path.GetExtension(Request.PathInfo); + + file = Path.Combine(ApplicationPaths.EncodedMediaCachePath, file); + + return ToStaticFileResult(file); + } + + /// <summary> + /// Gets the specified request. + /// </summary> + /// <param name="request">The request.</param> + /// <returns>System.Object.</returns> + public object Get(GetHlsVideoStream request) + { + return ProcessRequest(request); + } + /// <summary> /// Gets the audio arguments. /// </summary> |
