2
0

ChannelDynamicMediaSourceProvider.cs 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Threading;
  4. using System.Threading.Tasks;
  5. using MediaBrowser.Controller.Channels;
  6. using MediaBrowser.Controller.Entities;
  7. using MediaBrowser.Controller.Library;
  8. using MediaBrowser.Model.Dto;
  9. namespace Emby.Server.Implementations.Channels
  10. {
  11. /// <summary>
  12. /// A media source provider for channels.
  13. /// </summary>
  14. public class ChannelDynamicMediaSourceProvider : IMediaSourceProvider
  15. {
  16. private readonly ChannelManager _channelManager;
  17. /// <summary>
  18. /// Initializes a new instance of the <see cref="ChannelDynamicMediaSourceProvider"/> class.
  19. /// </summary>
  20. /// <param name="channelManager">The channel manager.</param>
  21. public ChannelDynamicMediaSourceProvider(IChannelManager channelManager)
  22. {
  23. _channelManager = (ChannelManager)channelManager;
  24. }
  25. /// <inheritdoc />
  26. public Task<IEnumerable<MediaSourceInfo>> GetMediaSources(BaseItem item, CancellationToken cancellationToken)
  27. {
  28. return item.SourceType == SourceType.Channel
  29. ? _channelManager.GetDynamicMediaSources(item, cancellationToken)
  30. : Task.FromResult<IEnumerable<MediaSourceInfo>>(new List<MediaSourceInfo>());
  31. }
  32. /// <inheritdoc />
  33. public Task<ILiveStream> OpenMediaSource(string openToken, List<ILiveStream> currentLiveStreams, CancellationToken cancellationToken)
  34. {
  35. throw new NotImplementedException();
  36. }
  37. }
  38. }