Pipeline YouTube con relay, overlay e publisher sync lato backend; fix GL pauseGlDuringRotation su Android per evitare crash in rotazione durante lo streaming Flutter. Co-authored-by: Cursor <cursoragent@cursor.com>
35 lines
880 B
Ruby
35 lines
880 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 grezzo MediaMTX (live/match_{uuid}).
|
|
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
|