using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using Jellyfin.Plugin.SRFPlay.Api.Models;
using Jellyfin.Plugin.SRFPlay.Configuration;
using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Entities;
namespace Jellyfin.Plugin.SRFPlay.Services.Interfaces;
///
/// Factory for creating MediaSourceInfo objects with consistent configuration.
///
public interface IMediaSourceFactory
{
///
/// Creates a MediaSourceInfo for a chapter with proper stream authentication and proxy registration.
///
/// The chapter containing stream resources.
/// The unique item ID for proxy registration.
/// The URN of the content.
/// The preferred quality.
/// The cancellation token.
/// A configured MediaSourceInfo, or null if stream URL cannot be resolved.
Task CreateMediaSourceAsync(
Chapter chapter,
string itemId,
string urn,
QualityPreference qualityPreference,
CancellationToken cancellationToken = default);
///
/// Builds a proxy URL for an item.
///
/// The item ID.
/// The full proxy URL including server address.
string BuildProxyUrl(string itemId);
///
/// Gets the server base URL (configured public URL or smart URL).
///
/// The server base URL without trailing slash.
string GetServerBaseUrl();
///
/// Creates MediaStream metadata based on quality preference.
///
/// The quality preference.
/// List of MediaStream objects for video and audio.
IReadOnlyList CreateMediaStreams(QualityPreference quality);
}