2019-01-13 12:54:44 -07:00
|
|
|
using System;
|
2015-03-28 13:22:27 -07:00
|
|
|
using System.Collections.Generic;
|
2020-04-15 12:00:45 -07:00
|
|
|
using System.Linq;
|
2015-03-28 13:22:27 -07:00
|
|
|
using System.Threading;
|
|
|
|
using System.Threading.Tasks;
|
2019-01-13 12:20:16 -07:00
|
|
|
using MediaBrowser.Controller.Channels;
|
|
|
|
using MediaBrowser.Controller.Entities;
|
|
|
|
using MediaBrowser.Controller.Library;
|
|
|
|
using MediaBrowser.Model.Dto;
|
2015-03-28 13:22:27 -07:00
|
|
|
|
2016-11-02 13:53:50 -07:00
|
|
|
namespace Emby.Server.Implementations.Channels
|
2015-03-28 13:22:27 -07:00
|
|
|
{
|
2020-04-14 12:28:02 -07:00
|
|
|
/// <summary>
|
|
|
|
/// A media source provider for channels.
|
|
|
|
/// </summary>
|
2015-03-28 13:22:27 -07:00
|
|
|
public class ChannelDynamicMediaSourceProvider : IMediaSourceProvider
|
|
|
|
{
|
|
|
|
private readonly ChannelManager _channelManager;
|
|
|
|
|
2019-11-01 10:38:54 -07:00
|
|
|
/// <summary>
|
|
|
|
/// Initializes a new instance of the <see cref="ChannelDynamicMediaSourceProvider"/> class.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="channelManager">The channel manager.</param>
|
2015-03-28 13:22:27 -07:00
|
|
|
public ChannelDynamicMediaSourceProvider(IChannelManager channelManager)
|
|
|
|
{
|
|
|
|
_channelManager = (ChannelManager)channelManager;
|
|
|
|
}
|
|
|
|
|
2019-11-01 10:38:54 -07:00
|
|
|
/// <inheritdoc />
|
2018-09-12 10:26:21 -07:00
|
|
|
public Task<IEnumerable<MediaSourceInfo>> GetMediaSources(BaseItem item, CancellationToken cancellationToken)
|
2015-03-28 13:22:27 -07:00
|
|
|
{
|
2020-04-14 12:28:02 -07:00
|
|
|
return item.SourceType == SourceType.Channel
|
|
|
|
? _channelManager.GetDynamicMediaSources(item, cancellationToken)
|
2020-04-15 12:00:45 -07:00
|
|
|
: Task.FromResult(Enumerable.Empty<MediaSourceInfo>());
|
2015-03-28 13:22:27 -07:00
|
|
|
}
|
|
|
|
|
2019-11-01 10:38:54 -07:00
|
|
|
/// <inheritdoc />
|
2018-09-12 10:26:21 -07:00
|
|
|
public Task<ILiveStream> OpenMediaSource(string openToken, List<ILiveStream> currentLiveStreams, CancellationToken cancellationToken)
|
2015-03-28 13:22:27 -07:00
|
|
|
{
|
|
|
|
throw new NotImplementedException();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|