XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet

XFENewsApplication

【WinUI】新闻软件

公开
关注 0 Fork 0 Star 0
UTF-8
using System.ComponentModel;
using System.Runtime.CompilerServices;

namespace XFENewsApplication.Models;

/// <summary>A video and its accompanying text, rendered by the article ListView.</summary>
public class VideoArticlePart : ArticlePart, INotifyPropertyChanged
{
    private string playbackError = string.Empty;

    public string Title { get; set; } = string.Empty;
    public string Description { get; set; } = string.Empty;
    public string PosterUrl { get; set; } = string.Empty;
    public string PageUrl { get; set; } = string.Empty;
    public string VideoId { get; set; } = string.Empty;

    /// <summary>Complete MP4 chapter sequence, used if the primary stream fails.</summary>
    public List<string> FallbackSourceUrls { get; set; } = [];

    /// <summary>Alternative complete streams; each URL is a candidate, not a chapter.</summary>
    public List<string> AlternativeSourceUrls { get; set; } = [];

    public string PlaybackError
    {
        get => playbackError;
        set
        {
            if (playbackError == value)
                return;
            playbackError = value;
            OnPropertyChanged();
        }
    }

    public event PropertyChangedEventHandler? PropertyChanged;

    private void OnPropertyChanged([CallerMemberName] string? propertyName = null) =>
        PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}