Stabilizza live YouTube/RTMP e fix crash rotazione mobile.
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>
This commit is contained in:
@@ -56,6 +56,7 @@ module Api
|
||||
fps: params[:fps],
|
||||
last_seen_at: Time.current
|
||||
)
|
||||
sync_publisher_when_streaming!(params[:fps].to_f)
|
||||
SessionChannel.broadcast_message(@session, state.as_cable_payload)
|
||||
head :no_content
|
||||
end
|
||||
@@ -172,6 +173,19 @@ module Api
|
||||
occurred_at: event.occurred_at
|
||||
}
|
||||
end
|
||||
|
||||
# L'app invia fps ogni ~10s; senza poll status.json l'overlay YouTube non partiva.
|
||||
def sync_publisher_when_streaming!(fps)
|
||||
return if fps < 1
|
||||
return if @session.terminal? || @session.paused?
|
||||
return unless @session.platform == "youtube"
|
||||
return unless @session.status.in?(%w[connecting live reconnecting])
|
||||
|
||||
Mediamtx::PublisherSync.new(@session).call
|
||||
if @session.platform == "youtube" && @session.status.in?(%w[live connecting reconnecting])
|
||||
Mediamtx::PublisherSync.schedule_youtube_pipeline!(@session, force: false)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user