Aggiunge overlay server-side burn-in e stabilizza diretta live.

Tabellone, badge e brand sono ricodificati nel flusso _air via OverlayRelay;
sync punteggio HTTP, volume condiviso rails/sidekiq, qualità 720p migliorata
e badge CONNECTING in ripresa da pausa.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-03 23:55:17 +02:00
parent fd225fbadd
commit ab9cb02083
58 changed files with 2423 additions and 242 deletions

View File

@@ -54,11 +54,11 @@ class StreamSession < ApplicationRecord
end
event :pause do
transitions from: %i[live reconnecting], to: :paused
transitions from: %i[live reconnecting connecting], to: :paused
end
event :resume do
transitions from: :paused, to: :live
transitions from: :paused, to: :connecting
end
event :finish do
@@ -81,13 +81,30 @@ class StreamSession < ApplicationRecord
"live/match_#{id}"
end
def mediamtx_overlay_path_name
"#{mediamtx_path_name}_air"
end
def matchlivetv_platform?
platform == "matchlivetv"
end
def hls_playback_url
base = MatchLiveTv.hls_public_url.chomp("/")
"#{base}/#{mediamtx_path_name}/index.m3u8"
"#{base}/#{effective_hls_path_name}/index.m3u8"
end
def effective_hls_path_name
return mediamtx_path_name if terminal?
return mediamtx_overlay_path_name unless Streams::OverlayRelay.running?(id)
return mediamtx_overlay_path_name if overlay_air_has_output?
mediamtx_path_name
end
def overlay_air_has_output?
info = Mediamtx::Client.new.list_paths.find { |i| i["name"] == mediamtx_overlay_path_name }
info && (info["online"] || info["ready"] || info["available"])
end
def watch_page_url