@using System.Collections.Specialized @using System.Web @using InnerTube.Models @model LightTube.Contexts.PlayerContext @{ ViewBag.Metadata = new Dictionary(); ViewBag.Metadata["author"] = Model.Video.Channel.Name; ViewBag.Metadata["og:title"] = Model.Player.Title; ViewBag.Metadata["og:url"] = $"{Url.ActionContext.HttpContext.Request.Scheme}://{Url.ActionContext.HttpContext.Request.Host}{Url.ActionContext.HttpContext.Request.Path}{Url.ActionContext.HttpContext.Request.QueryString}"; ViewBag.Metadata["og:image"] = $"{Url.ActionContext.HttpContext.Request.Scheme}://{Url.ActionContext.HttpContext.Request.Host}/proxy/image?url={HttpUtility.UrlEncode(Model.Player.Thumbnails.FirstOrDefault()?.Url?.ToString())}"; ViewBag.Metadata["twitter:card"] = $"{Url.ActionContext.HttpContext.Request.Scheme}://{Url.ActionContext.HttpContext.Request.Host}/proxy/image?url={HttpUtility.UrlEncode(Model.Player.Thumbnails.LastOrDefault()?.Url?.ToString())}"; ViewBag.Metadata["og:description"] = Model.Player.Description; ViewBag.Title = Model.Player.Title; Layout = null; try { ViewBag.Metadata["og:video"] = $"/proxy/video?url={HttpUtility.UrlEncode(Model.Player.Formats.First().Url.ToString())}"; Model.Resolution ??= Model.Player.Formats.First().FormatNote; } catch { } bool live = Model.Player.Formats.Length == 0 && Model.Player.AdaptiveFormats.Length > 0; bool canPlay = true; } @if (ViewBag.Metadata is not null) { @foreach (KeyValuePair metaTag in ViewBag.Metadata) { if (metaTag.Key.StartsWith("og:")) { } else { } } } @ViewData["Title"] - lighttube @if (live) { } else if (Model.Player.Formats.Length > 0) { } else { canPlay = false;
@if (string.IsNullOrWhiteSpace(Model.Player.ErrorMessage)) { No playable streams returned from the API (@Model.Player.Formats.Length/@Model.Player.AdaptiveFormats.Length) } else { @Model.Player.ErrorMessage }
} @if (canPlay) { @if (!Model.CompatibilityMode && !live) { } else if (live) { } else { } }