Così overflow Hetzner e VOD YouTube restano in archivio dopo lo spegnimento del nodo, e la colonna ingest non si svuota. Co-authored-by: Cursor <cursoragent@cursor.com>
101 lines
4.8 KiB
ERB
101 lines
4.8 KiB
ERB
<% club_name = @match.team.club&.name %>
|
|
<% content_for :title, t("replay.show.title", title: @recording.title_or_default) %>
|
|
<% content_for :meta_description, t("replay.show.meta_description", title: @recording.title_or_default) %>
|
|
<% content_for :robots, @recording.publicly_listed? ? "index, follow" : "noindex, nofollow" %>
|
|
|
|
<div class="wrap">
|
|
<%= link_to t("replay.show.back_to_replays"), public_replay_index_path, class: "back-link" %>
|
|
|
|
<%= live_match_page_heading(@match) %>
|
|
|
|
<% if @recording.status == "processing" %>
|
|
<div class="stream-ended" role="status">
|
|
<div class="stream-ended-icon" aria-hidden="true">⏳</div>
|
|
<h2><%= t("replay.show.processing_title") %></h2>
|
|
<p><%= t("replay.show.processing_body") %></p>
|
|
</div>
|
|
<% elsif @recording.ready? && @recording.replay_source == "youtube" && @recording.youtube_video_id.present? && !@recording.youtube_video_id.to_s.start_with?("mock_") %>
|
|
<div class="live-player-wrap live-player-wrap--embed">
|
|
<iframe src="https://www.youtube.com/embed/<%= @recording.youtube_video_id %>"
|
|
title="<%= @recording.title_or_default %>"
|
|
class="live-player-embed"
|
|
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
|
|
allowfullscreen></iframe>
|
|
<%= render "public/live/player_overlays",
|
|
match: @match,
|
|
session: @session,
|
|
stream_closed: true,
|
|
on_air: false,
|
|
badge_label: t("replay.show.badge_label"),
|
|
badge_class: "badge-ended" %>
|
|
</div>
|
|
<p class="replay-show__meta-line">
|
|
<%= l_local(@recording.recorded_at_or_fallback) %>
|
|
· <%= t("replay.show.meta_line_duration", value: @recording.duration_label) %>
|
|
· <%= @recording.views_label %>
|
|
<% if @recording.source_platform_label != "—" %>
|
|
· <%= @recording.source_platform_label %>
|
|
<% end %>
|
|
</p>
|
|
<p class="replay-show__meta-line">
|
|
<%= t("replay.show.youtube_only_body") %>
|
|
<%= link_to t("replay.show.youtube_link"), @recording.youtube_watch_url, target: "_blank", rel: "noopener" %>
|
|
</p>
|
|
<% elsif @recording.ready? && @recording.storage_key.present? %>
|
|
<div class="live-player-wrap">
|
|
<video id="replay-player" controls playsinline preload="metadata"
|
|
poster="<%= @recording.thumbnail_url.presence || '/images/copertina-canale.png' %>">
|
|
<source src="<%= public_replay_stream_path(@session) %>" type="video/mp4">
|
|
</video>
|
|
<%= render "public/live/player_overlays",
|
|
match: @match,
|
|
session: @session,
|
|
stream_closed: true,
|
|
on_air: false,
|
|
badge_label: t("replay.show.badge_label"),
|
|
badge_class: "badge-ended" %>
|
|
</div>
|
|
|
|
<p class="replay-show__meta-line">
|
|
<%= l_local(@recording.recorded_at_or_fallback) %>
|
|
· <%= t("replay.show.meta_line_duration", value: @recording.duration_label) %>
|
|
· <%= @recording.views_label %>
|
|
<% if @recording.expires_at %>
|
|
· <%= t("replay.show.meta_line_until", date: l_local(@recording.expires_at)) %>
|
|
<% end %>
|
|
· <%= @recording.publicly_listed? ? t("replay.show.meta_line_public") : t("replay.show.meta_line_private") %>
|
|
<% if @recording.source_platform_label != "—" %>
|
|
· <%= @recording.source_platform_label %>
|
|
<% end %>
|
|
</p>
|
|
|
|
<% ent = @recording.team.entitlements %>
|
|
<% if (ent.phone_download_enabled? && @recording.storage_key.present? && (logged_in? || @recording.unlisted?)) || @recording.youtube_watch_url %>
|
|
<div class="replay-show__actions">
|
|
<% if ent.phone_download_enabled? && @recording.storage_key.present? && (logged_in? || @recording.unlisted?) %>
|
|
<%= link_to t("replay.show.download_link"), public_replay_download_path(@session), class: "btn btn-primary" %>
|
|
<% end %>
|
|
<% if @recording.youtube_watch_url %>
|
|
<%= link_to t("replay.show.youtube_link"), @recording.youtube_watch_url, class: "btn btn-secondary", target: "_blank", rel: "noopener" %>
|
|
<% end %>
|
|
</div>
|
|
<% end %>
|
|
<% elsif @recording.ready? %>
|
|
<div class="stream-ended" role="status">
|
|
<h2><%= t("replay.show.file_missing_title") %></h2>
|
|
<p><%= t("replay.show.file_missing_body") %></p>
|
|
<p class="stream-ended-meta"><%= t("replay.show.file_missing_meta", duration: @recording.duration_label, size: @recording.byte_size_label) %></p>
|
|
</div>
|
|
<% elsif @recording.status == "failed" %>
|
|
<div class="stream-ended" role="status">
|
|
<h2><%= t("replay.show.failed_title") %></h2>
|
|
<p><%= @recording.error_message.presence || t("replay.show.failed_default_body") %></p>
|
|
</div>
|
|
<% else %>
|
|
<div class="stream-ended" role="status">
|
|
<h2><%= t("replay.show.unavailable_title") %></h2>
|
|
<p><%= t("replay.show.unavailable_body") %></p>
|
|
</div>
|
|
<% end %>
|
|
</div>
|