PublisherSync: rileva publisher anche con source RTMP attivo
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -10,7 +10,7 @@ module Mediamtx
|
|||||||
return @session if @session.terminal?
|
return @session if @session.terminal?
|
||||||
|
|
||||||
info = Mediamtx::Client.new.list_paths.find { |i| i["name"] == @session.mediamtx_path_name }
|
info = Mediamtx::Client.new.list_paths.find { |i| i["name"] == @session.mediamtx_path_name }
|
||||||
publisher_online = info && info["online"]
|
publisher_online = publisher_online?(info)
|
||||||
|
|
||||||
if publisher_online
|
if publisher_online
|
||||||
if @session.paused?
|
if @session.paused?
|
||||||
@@ -35,6 +35,15 @@ module Mediamtx
|
|||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
|
def publisher_online?(info)
|
||||||
|
return false unless info
|
||||||
|
|
||||||
|
return true if info["online"]
|
||||||
|
return true if info["source"].present?
|
||||||
|
|
||||||
|
false
|
||||||
|
end
|
||||||
|
|
||||||
def cancel_timeout
|
def cancel_timeout
|
||||||
return if @session.timeout_job_id.blank?
|
return if @session.timeout_job_id.blank?
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user