2015-03-28 20:22:27 +00: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;
|
|
|
|
|
|
|
|
|
|
namespace MediaBrowser.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 channelItem = item as IChannelMediaItem;
|
|
|
|
|
|
|
|
|
|
if (channelItem != null)
|
|
|
|
|
{
|
|
|
|
|
return _channelManager.GetDynamicMediaSources(channelItem, cancellationToken);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return Task.FromResult<IEnumerable<MediaSourceInfo>>(new List<MediaSourceInfo>());
|
|
|
|
|
}
|
|
|
|
|
|
2015-03-29 04:56:39 +00:00
|
|
|
|
public Task<MediaSourceInfo> OpenMediaSource(string openToken, CancellationToken cancellationToken)
|
2015-03-28 20:22:27 +00:00
|
|
|
|
{
|
|
|
|
|
throw new NotImplementedException();
|
|
|
|
|
}
|
|
|
|
|
|
2015-03-29 04:56:39 +00:00
|
|
|
|
public Task CloseMediaSource(string liveStreamId, CancellationToken cancellationToken)
|
2015-03-28 20:22:27 +00:00
|
|
|
|
{
|
|
|
|
|
throw new NotImplementedException();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|