Player contenuto come la diretta, fix streaming thumbnail da S3, volume persistente ActiveStorage in produzione. Co-authored-by: Cursor <cursoragent@cursor.com>
93 lines
4.1 KiB
Plaintext
93 lines
4.1 KiB
Plaintext
<% club_name = @match.team.club&.name %>
|
||
<% content_for :title, "Replay — #{@recording.title_or_default}" %>
|
||
<% content_for :meta_description, "Replay #{@recording.title_or_default} su Match Live TV." %>
|
||
<% content_for :robots, @recording.publicly_listed? ? "index, follow" : "noindex, nofollow" %>
|
||
|
||
<div class="wrap">
|
||
<%= link_to "← Live passate", 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>Replay in elaborazione</h2>
|
||
<p>La registrazione viene preparata. Riceverai un’email quando sarà pronta.</p>
|
||
</div>
|
||
<% 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: "REPLAY",
|
||
badge_class: "badge-ended" %>
|
||
</div>
|
||
|
||
<p class="replay-show__meta-line">
|
||
<%= l_local(@recording.recorded_at_or_fallback) %>
|
||
· Durata <%= @recording.duration_label %>
|
||
· <%= @recording.views_label %>
|
||
<% if @recording.expires_at %>
|
||
· Fino al <%= l_local(@recording.expires_at) %>
|
||
<% end %>
|
||
· <%= @recording.publicly_listed? ? "Pubblico" : "Privato (link)" %>
|
||
<% if @recording.source_platform_label != "—" %>
|
||
· <%= @recording.source_platform_label %>
|
||
<% end %>
|
||
</p>
|
||
|
||
<% ent = @recording.team.entitlements %>
|
||
<% if (ent.phone_download_enabled? && (logged_in? || @recording.unlisted?)) || @recording.youtube_watch_url %>
|
||
<div class="replay-show__actions">
|
||
<% if ent.phone_download_enabled? && (logged_in? || @recording.unlisted?) %>
|
||
<%= link_to "Scarica MP4", public_replay_download_path(@session), class: "btn btn-primary" %>
|
||
<% end %>
|
||
<% if @recording.youtube_watch_url %>
|
||
<%= link_to "Apri su YouTube", @recording.youtube_watch_url, class: "btn btn-secondary", target: "_blank", rel: "noopener" %>
|
||
<% end %>
|
||
</div>
|
||
<% end %>
|
||
<% elsif @recording.ready? && @recording.youtube_watch_url.present? %>
|
||
<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: "REPLAY",
|
||
badge_class: "badge-ended" %>
|
||
</div>
|
||
<p class="replay-show__meta-line">
|
||
Replay su YouTube (copia server non presente).
|
||
<%= link_to "Apri su YouTube", @recording.youtube_watch_url, target: "_blank", rel: "noopener" %>
|
||
</p>
|
||
<% elsif @recording.ready? %>
|
||
<div class="stream-ended" role="status">
|
||
<h2>File non disponibile</h2>
|
||
<p>Il video non è più sul server (archivio rimosso o in migrazione).</p>
|
||
<p class="stream-ended-meta">Durata registrata: <%= @recording.duration_label %> · <%= @recording.byte_size_label %></p>
|
||
</div>
|
||
<% elsif @recording.status == "failed" %>
|
||
<div class="stream-ended" role="status">
|
||
<h2>Replay non disponibile</h2>
|
||
<p><%= @recording.error_message.presence || "Errore di elaborazione della registrazione." %></p>
|
||
</div>
|
||
<% else %>
|
||
<div class="stream-ended" role="status">
|
||
<h2>Replay non disponibile</h2>
|
||
<p>Questa registrazione non è più accessibile.</p>
|
||
</div>
|
||
<% end %>
|
||
</div>
|