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:
34
backend/app/controllers/concerns/mediamtx_playback.rb
Normal file
34
backend/app/controllers/concerns/mediamtx_playback.rb
Normal file
@@ -0,0 +1,34 @@
|
||||
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
|
||||
Reference in New Issue
Block a user