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

<%= HTML.escape(video.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)) } %>

<% end %>
<%= translate(locale, "Watch on YouTube") %>

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

<% if user %> <% playlists = PG_DB.query_all("SELECT id,title FROM playlists WHERE author = $1 AND id LIKE 'IV%'", user.email, as: {String, String}) %> <% if !playlists.empty? %>
<% end %> <% end %> <% if CONFIG.dmca_content.includes?(video.id) || CONFIG.disabled?("downloads") %>

<%= translate(locale, "Download is disabled.") %>

<% else %>
<% end %>

<%= number_with_separator(video.views) %>

<%= number_with_separator(video.likes) %>

<%= number_with_separator(video.dislikes) %>

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

<% if video.license %>

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

<% end %>

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

<%= translate(locale, "Wilson score: ") %><%= video.wilson_score %>

<%= translate(locale, "Rating: ") %><%= video.average_rating %> / 5

<%= translate(locale, "Engagement: ") %><%= video.engagement %>%

<% 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.author_thumbnail.empty? %> <% end %> <%= video.author %>
<% ucid = video.ucid %> <% author = video.author %> <% sub_count_text = video.sub_count_text %> <%= rendered "components/subscribe_widget" %>

<% 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 %>

<%= video.description_html %>

<% 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 %>
/mqdefault.jpg">

<%= recode_length_seconds(rv["length_seconds"]?.try &.to_i? || 0) %>

<% end %>

<%= rv["title"] %>

<% if rv["ucid"]? %> "><%= rv["author"]? %> <% else %> <%= rv["author"]? %> <% end %>
<% if views = rv["short_view_count_text"]?.try &.delete(", views watching") %> <% if !views.empty? %> <%= translate(locale, "`x` views", views) %> <% end %> <% end %>
<% end %> <% end %>
<% end %>
<% end %>