diff --git a/livekit/src/room/participant/local_participant.rs b/livekit/src/room/participant/local_participant.rs index b9d955628..741bfe960 100644 --- a/livekit/src/room/participant/local_participant.rs +++ b/livekit/src/room/participant/local_participant.rs @@ -873,6 +873,11 @@ impl LocalParticipant { + 'static, ) { self.local.rpc_state.lock().handlers.insert(method, Arc::new(handler)); + + // Pre-connect the publisher PC so ACKs can be sent immediately when requests arrive. + // Without this, the first RPC request would trigger publisher negotiation, causing + // a ~300-500ms delay before the ACK can be sent (ICE negotiation time). + self.inner.rtc_engine.publisher_negotiation_needed(); } pub fn unregister_rpc_method(&self, method: String) {