Files
MatchLiveTv/backend/app/controllers/concerns/mediamtx_playback.rb
Emiliano Frascaro ab9cb02083 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>
2026-06-03 23:55:17 +02:00

35 lines
887 B
Ruby

module MediamtxPlayback
extend ActiveSupport::Concern
private
def mediamtx_paths_index
@mediamtx_paths_index ||= Mediamtx::Client.new.list_paths.index_by { |i| i["name"] }
end
def mediamtx_path_info(session, path_name: mediamtx_playback_path_name(session))
mediamtx_paths_index[path_name]
end
def mediamtx_playback_path_name(session)
session.effective_hls_path_name
end
# Player HLS: path _air con overlay quando il relay è attivo.
def mediamtx_stream_playable?(session)
return false if session.terminal?
mediamtx_path_has_output?(session)
end
def mediamtx_path_has_output?(session)
info = mediamtx_path_info(session)
info && (info["ready"] || info["available"] || info["online"])
end
def mediamtx_publisher_online?(session)
info = mediamtx_paths_index[session.mediamtx_path_name]
info && info["online"]
end
end