Streaming chunked da Garage, purge con delete YouTube, privacy sincronizzata, archivio club migliorato, retention 30/90 separata da stato abbonamento. Co-authored-by: Cursor <cursoragent@cursor.com>
83 lines
3.9 KiB
Plaintext
83 lines
3.9 KiB
Plaintext
<% 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 replay-show">
|
||
<%= link_to "← Live passate", public_replay_index_path, class: "back-link" %>
|
||
|
||
<header class="replay-show__header">
|
||
<h1><%= @recording.title_or_default %></h1>
|
||
<p class="replay-show__meta">
|
||
<%= @match.team.club.name %> · <%= l_local(@recording.recorded_at_or_fallback) %>
|
||
· <%= @recording.views_label %>
|
||
<% if @recording.source_platform_label != "—" %>
|
||
· <%= @recording.source_platform_label %>
|
||
<% end %>
|
||
</p>
|
||
</header>
|
||
|
||
<% if @recording.status == "processing" %>
|
||
<div class="card replay-show__status">
|
||
<p>Registrazione in elaborazione. Riceverai un’email quando sarà pronta.</p>
|
||
</div>
|
||
<% elsif @recording.ready? && @recording.storage_key.present? %>
|
||
<div class="replay-show__player card">
|
||
<video id="replay-player" class="replay-video" controls playsinline preload="metadata"
|
||
<% if @recording.thumbnail_url %> poster="<%= @recording.thumbnail_url %>"<% end %>>
|
||
<source src="<%= public_replay_stream_path(@session) %>" type="video/mp4">
|
||
</video>
|
||
</div>
|
||
|
||
<div class="replay-show__details card">
|
||
<p class="replay-show__details-line">
|
||
<span>Durata <%= @recording.duration_label %></span>
|
||
<% if @recording.expires_at %>
|
||
<span>· Disponibile fino al <%= l_local(@recording.expires_at) %></span>
|
||
<% end %>
|
||
<span>· <%= @recording.publicly_listed? ? "Pubblico" : "Privato (link)" %></span>
|
||
<% if @recording.byte_size.to_i.positive? %>
|
||
<span>· <%= @recording.byte_size_label %></span>
|
||
<% end %>
|
||
</p>
|
||
<% ent = @recording.team.entitlements %>
|
||
<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>
|
||
</div>
|
||
<% elsif @recording.ready? && @recording.youtube_watch_url.present? %>
|
||
<div class="replay-show__player card">
|
||
<div class="replay-video" style="position:relative;padding-bottom:56.25%;height:0;overflow:hidden;background:#000;border-radius:12px">
|
||
<iframe src="https://www.youtube.com/embed/<%= @recording.youtube_video_id %>"
|
||
title="<%= @recording.title_or_default %>"
|
||
style="position:absolute;top:0;left:0;width:100%;height:100%;border:0"
|
||
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
|
||
allowfullscreen></iframe>
|
||
</div>
|
||
</div>
|
||
<div class="replay-show__details card">
|
||
<p class="replay-show__details-line">
|
||
Replay disponibile su YouTube (copia server non presente).
|
||
<%= link_to "Apri su YouTube", @recording.youtube_watch_url, target: "_blank", rel: "noopener" %>
|
||
</p>
|
||
</div>
|
||
<% elsif @recording.ready? %>
|
||
<div class="card replay-show__status">
|
||
<p>Il file video non è più disponibile (archivio rimosso o in migrazione).</p>
|
||
<p class="replay-show__details-line">Durata registrata: <%= @recording.duration_label %> · <%= @recording.byte_size_label %></p>
|
||
</div>
|
||
<% elsif @recording.status == "failed" %>
|
||
<div class="card replay-show__status">
|
||
<p>Replay non disponibile: <%= @recording.error_message.presence || "errore di elaborazione" %>.</p>
|
||
</div>
|
||
<% else %>
|
||
<div class="card replay-show__status">
|
||
<p>Replay non più disponibile.</p>
|
||
</div>
|
||
<% end %>
|
||
</div>
|