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:
2026-06-06 15:30:55 +02:00
parent 1058c644bd
commit 854738b46d
65 changed files with 2606 additions and 579 deletions

View File

@@ -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