% 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" %>
<%= link_to t("replay.show.back_to_replays"), public_replay_index_path, class: "back-link" %>
<%= live_match_page_heading(@match) %>
<% if @recording.status == "processing" %>
⏳
<%= t("replay.show.processing_title") %>
<%= t("replay.show.processing_body") %>
<% elsif @recording.ready? && @recording.replay_source == "youtube" && @recording.youtube_video_id.present? && !@recording.youtube_video_id.to_s.start_with?("mock_") %>
<%= 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" %>
<%= 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 %>
<%= t("replay.show.youtube_only_body") %>
<%= link_to t("replay.show.youtube_link"), @recording.youtube_watch_url, target: "_blank", rel: "noopener" %>
<% elsif @recording.ready? && @recording.storage_key.present? %>
<%= 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" %>
<%= 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 %>
<% ent = @recording.team.entitlements %>
<% if (ent.phone_download_enabled? && @recording.storage_key.present? && (logged_in? || @recording.unlisted?)) || @recording.youtube_watch_url %>
<% 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 %>
<% end %>
<% elsif @recording.ready? %>
<%= t("replay.show.file_missing_title") %>
<%= t("replay.show.file_missing_body") %>
<%= t("replay.show.file_missing_meta", duration: @recording.duration_label, size: @recording.byte_size_label) %>
<% elsif @recording.status == "failed" %>
<%= t("replay.show.failed_title") %>
<%= @recording.error_message.presence || t("replay.show.failed_default_body") %>
<% else %>
<%= t("replay.show.unavailable_title") %>
<%= t("replay.show.unavailable_body") %>
<% end %>