<% ucid = video.ucid %> <% title = HTML.escape(video.title) %> <% author = HTML.escape(video.author) %> <% content_for "header" do %> "> <%= rendered "components/player_sources" %> <%= title %> - Invidious <% end %>
<%= rendered "components/player" %>

<%= title %> <% if params.listen %> " href="/watch?<%= env.params.query %>&listen=0"> <% else %> " href="/watch?<%= env.params.query %>&listen=1"> <% end %>

<% if !video.is_listed %>

<%= translate(locale, "Unlisted") %>

<% end %> <% if video.reason %>

<%= video.reason %>

<% elsif video.premiere_timestamp.try &.> Time.utc %>

<%= video.premiere_timestamp.try { |t| translate(locale, "Premieres in `x`", recode_date((t - Time.utc).ago, locale)) } %>

<% elsif video.live_now %>

<%= video.premiere_timestamp.try { |t| translate(locale, "videoinfo_started_streaming_x_ago", recode_date((Time.utc - t).ago, locale)) } %>

<% end %>
<%- link_yt_watch = URI.new(scheme: "https", host: "www.youtube.com", path: "/watch", query: "v=#{video.id}") link_yt_embed = URI.new(scheme: "https", host: "www.youtube.com", path: "/embed/#{video.id}") if !plid.nil? && !continuation.nil? link_yt_param = URI::Params{"plid" => [plid], "index" => [continuation.to_s]} link_yt_watch = IV::HttpServer::Utils.add_params_to_url(link_yt_watch, link_yt_param) link_yt_embed = IV::HttpServer::Utils.add_params_to_url(link_yt_embed, link_yt_param) end -%> <%= translate(locale, "videoinfo_watch_on_youTube") %> (<%= translate(locale, "videoinfo_youTube_embed_link") %>)

<%- link_iv_other = IV::Frontend::Misc.redirect_url(env) -%> <%= translate(locale, "Switch Invidious Instance") %>

<% if params.annotations %> <%= translate(locale, "Hide annotations") %> <% else %> <%=translate(locale, "Show annotations")%> <% end %>

<% if user %> <% playlists = Invidious::Database::Playlists.select_user_created_playlists(user.email) %> <% if !playlists.empty? %>
">
<% end %> <% end %> <%= Invidious::Frontend::WatchPage.download_widget(locale, video, video_assets) %>

<%= number_with_separator(video.views) %>

<%= number_with_separator(video.likes) %>

<%= translate(locale, "Genre: ") %> <% if !video.genre_url %> <%= video.genre %> <% else %> <%= video.genre %> <% end %>

<% if video.license %> <% if video.license.empty? %>

<%= translate(locale, "License: ") %><%= translate(locale, "Standard YouTube license") %>

<% else %>

<%= translate(locale, "License: ") %><%= video.license %>

<% end %> <% end %>

<%= translate(locale, "Family friendly? ") %><%= translate_bool(locale, video.is_family_friendly) %>

<% if video.allowed_regions.size != REGIONS.size %>

<% if video.allowed_regions.size < REGIONS.size // 2 %> <%= translate(locale, "Whitelisted regions: ") %><%= video.allowed_regions.join(", ") %> <% else %> <%= translate(locale, "Blacklisted regions: ") %><%= (REGIONS.to_a - video.allowed_regions).join(", ") %> <% end %>

<% end %>

<% if video.premiere_timestamp.try &.> Time.utc %> <%= video.premiere_timestamp.try { |t| translate(locale, "Premieres `x`", t.to_s("%B %-d, %R UTC")) } %> <% else %> <%= translate(locale, "Shared `x`", video.published.to_s("%B %-d, %Y")) %> <% end %>

<% if video.description.size < 200 || params.extend_desc %>
<%= video.description_html %>
<% else %>
<%= video.description_html %>
<% end %>

<% if !video.music.empty? %>
<% video.music.each do |music| %>

<%= translate(locale, "Song: ") %><%= music.song %>

<%= translate(locale, "Artist: ") %><%= music.artist %>

<%= translate(locale, "Album: ") %><%= music.album %>

<% end %>

<% end %>
<% if params.related_videos || plid %>
<% if plid %>
<% end %> <% if params.related_videos %>
<% if !video.related_videos.empty? %>
style="display:none"<% end %>>
checked<% end %>>

<% end %> <% video.related_videos.each do |rv| %> <% if rv["id"]? %>
<%- if !env.get("preferences").as(Preferences).thin_mode -%> &listen=<%= params.listen %>"> /mqdefault.jpg" alt="" /> <%- else -%>
<%- end -%>
<%- if (length_seconds = rv["length_seconds"]?.try &.to_i?) && length_seconds != 0 -%>

<%= recode_length_seconds(length_seconds) %>

<%- end -%>
<% if !rv["ucid"].empty? %> "><%= rv["author"]? %><% if rv["author_verified"]? == "true" %> <% end %> <% else %> <%= rv["author"]? %><% if rv["author_verified"]? == "true" %> <% end %> <% end %>
<%= views = rv["view_count"]?.try &.to_i? views ||= rv["view_count_short"]?.try { |x| short_text_to_number(x) } translate_count(locale, "generic_views_count", views || 0, NumberFormatting::Short) %>
<% end %> <% end %>
<% end %>
<% end %>