aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/Channels/ChannelDynamicMediaSourceProvider.cs
diff options
context:
space:
mode:
authorLuke <luke.pulverenti@gmail.com>2016-11-03 19:59:50 -0400
committerGitHub <noreply@github.com>2016-11-03 19:59:50 -0400
commitc53745548ac2130f4cfbbe0d7a2804c36c8ae4eb (patch)
tree6ee298ebb5470c4f3bcbef8d814a0354901469c4 /Emby.Server.Implementations/Channels/ChannelDynamicMediaSourceProvider.cs
parent338b04a0c58729ec70aed89924ea6bd12422872b (diff)
parent405a5f69c5967b4d919b5fe91396f12cb83e8aa8 (diff)
Merge pull request #2267 from MediaBrowser/dev
Dev
Diffstat (limited to 'Emby.Server.Implementations/Channels/ChannelDynamicMediaSourceProvider.cs')
-rw-r--r--Emby.Server.Implementations/Channels/ChannelDynamicMediaSourceProvider.cs43
1 files changed, 43 insertions, 0 deletions
diff --git a/Emby.Server.Implementations/Channels/ChannelDynamicMediaSourceProvider.cs b/Emby.Server.Implementations/Channels/ChannelDynamicMediaSourceProvider.cs
new file mode 100644
index 000000000..98011ddd4
--- /dev/null
+++ b/Emby.Server.Implementations/Channels/ChannelDynamicMediaSourceProvider.cs
@@ -0,0 +1,43 @@
+using MediaBrowser.Controller.Channels;
+using MediaBrowser.Controller.Entities;
+using MediaBrowser.Controller.Library;
+using MediaBrowser.Model.Dto;
+using System;
+using System.Collections.Generic;
+using System.Threading;
+using System.Threading.Tasks;
+
+namespace Emby.Server.Implementations.Channels
+{
+ public class ChannelDynamicMediaSourceProvider : IMediaSourceProvider
+ {
+ private readonly ChannelManager _channelManager;
+
+ public ChannelDynamicMediaSourceProvider(IChannelManager channelManager)
+ {
+ _channelManager = (ChannelManager)channelManager;
+ }
+
+ public Task<IEnumerable<MediaSourceInfo>> GetMediaSources(IHasMediaSources item, CancellationToken cancellationToken)
+ {
+ var baseItem = (BaseItem) item;
+
+ if (baseItem.SourceType == SourceType.Channel)
+ {
+ return _channelManager.GetDynamicMediaSources(baseItem, cancellationToken);
+ }
+
+ return Task.FromResult<IEnumerable<MediaSourceInfo>>(new List<MediaSourceInfo>());
+ }
+
+ public Task<Tuple<MediaSourceInfo, IDirectStreamProvider>> OpenMediaSource(string openToken, CancellationToken cancellationToken)
+ {
+ throw new NotImplementedException();
+ }
+
+ public Task CloseMediaSource(string liveStreamId)
+ {
+ throw new NotImplementedException();
+ }
+ }
+}