2015-03-28 13:22:27 -07:00
|
|
|
|
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;
|
|
|
|
|
|
2016-11-02 13:53:50 -07:00
|
|
|
|
namespace Emby.Server.Implementations.Channels
|
2015-03-28 13:22:27 -07:00
|
|
|
|
{
|
|
|
|
|
public class ChannelDynamicMediaSourceProvider : IMediaSourceProvider
|
|
|
|
|
{
|
|
|
|
|
private readonly ChannelManager _channelManager;
|
|
|
|
|
|
|
|
|
|
public ChannelDynamicMediaSourceProvider(IChannelManager channelManager)
|
|
|
|
|
{
|
|
|
|
|
_channelManager = (ChannelManager)channelManager;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Task<IEnumerable<MediaSourceInfo>> GetMediaSources(IHasMediaSources item, CancellationToken cancellationToken)
|
|
|
|
|
{
|
2016-03-18 21:22:33 -07:00
|
|
|
|
var baseItem = (BaseItem) item;
|
2015-03-28 13:22:27 -07:00
|
|
|
|
|
2016-03-18 21:22:33 -07:00
|
|
|
|
if (baseItem.SourceType == SourceType.Channel)
|
2015-03-28 13:22:27 -07:00
|
|
|
|
{
|
2016-03-18 21:22:33 -07:00
|
|
|
|
return _channelManager.GetDynamicMediaSources(baseItem, cancellationToken);
|
2015-03-28 13:22:27 -07:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return Task.FromResult<IEnumerable<MediaSourceInfo>>(new List<MediaSourceInfo>());
|
|
|
|
|
}
|
|
|
|
|
|
2017-07-02 11:58:56 -07:00
|
|
|
|
public Task<Tuple<MediaSourceInfo, IDirectStreamProvider>> OpenMediaSource(string openToken, bool allowLiveStreamProbe, CancellationToken cancellationToken)
|
2015-03-28 13:22:27 -07:00
|
|
|
|
{
|
|
|
|
|
throw new NotImplementedException();
|
|
|
|
|
}
|
|
|
|
|
|
2016-09-29 05:55:49 -07:00
|
|
|
|
public Task CloseMediaSource(string liveStreamId)
|
2015-03-28 13:22:27 -07:00
|
|
|
|
{
|
|
|
|
|
throw new NotImplementedException();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|