diff --git a/backend/app/services/mediamtx/publisher_sync.rb b/backend/app/services/mediamtx/publisher_sync.rb index 3e20de0..3a00259 100644 --- a/backend/app/services/mediamtx/publisher_sync.rb +++ b/backend/app/services/mediamtx/publisher_sync.rb @@ -10,7 +10,7 @@ module Mediamtx return @session if @session.terminal? 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 @session.paused? @@ -35,6 +35,15 @@ module Mediamtx 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 return if @session.timeout_job_id.blank?