using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Logging;
using MediaBrowser.UI.Configuration;
using System.Collections.Generic;
using System.Windows;
namespace MediaBrowser.UI.Playback.InternalPlayer
{
///
/// Class BaseInternalMediaPlayer
///
public abstract class BaseInternalMediaPlayer : BaseMediaPlayer
{
protected BaseInternalMediaPlayer(ILogger logger) : base(logger)
{
}
///
/// Ensures the media player created.
///
protected abstract void EnsureMediaPlayerCreated();
///
/// Plays the internal.
///
/// The items.
/// The options.
/// The player configuration.
protected override void PlayInternal(List items, PlayOptions options, PlayerConfiguration playerConfiguration)
{
App.Instance.ApplicationWindow.Dispatcher.Invoke(() =>
{
App.Instance.ApplicationWindow.BackdropContainer.Visibility = Visibility.Collapsed;
App.Instance.ApplicationWindow.WindowBackgroundContent.SetResourceReference(FrameworkElement.StyleProperty, "WindowBackgroundContentDuringPlayback");
});
App.Instance.NavigateToInternalPlayerPage();
}
///
/// Called when [player stopped internal].
///
protected override void OnPlayerStoppedInternal()
{
App.Instance.ApplicationWindow.Dispatcher.Invoke(() =>
{
App.Instance.ApplicationWindow.BackdropContainer.Visibility = Visibility.Visible;
App.Instance.ApplicationWindow.WindowBackgroundContent.SetResourceReference(FrameworkElement.StyleProperty, "WindowBackgroundContent");
});
base.OnPlayerStoppedInternal();
}
}
}