Cross-Browser Video Issues – Is Browser-Specific singlePeerConnection the Right Fix?

Hi ,

We’ve been facing a couple of cross-browser issues in production and wanted to understand whether the solution we’ve implemented is the correct long-term approach or if there’s a better recommendation.

Issues Observed

1. Cross-browser video visibility issues

  • Firefox users cannot see video published from Safari (MacBook).

  • Edge users cannot see video from other participants.

  • Chrome users appear to work normally.

2. Firefox video freezes

  • Firefox participants sometimes get stuck on video streams.

  • The room remains connected, but video does not update correctly.

Environment

  • React + LiveKit Components

  • Adaptive Stream enabled

  • Dynacast enabled

  • VP8 codec

  • E2EE optional

After troubleshooting, we suspected the issue might be related to the experimental singlePeerConnection mode.

Solution Implemented

Instead of enabling singlePeerConnection globally, we only enable it for Chrome/Chromium browsers and fall back to the traditional two PeerConnection model for Firefox, Safari, and Edge.

const supportsSinglePeerConnection = React.useMemo(() => {
  if (typeof navigator === 'undefined') return false;

  const ua = navigator.userAgent;

  if (ua.includes('Edg/') || ua.includes('Edge/')) return false;
  if (ua.includes('Firefox')) return false;
  if (
    ua.includes('Safari') &&
    !ua.includes('Chrome') &&
    !ua.includes('Chromium')
  )
    return false;

  return ua.includes('Chrome') || ua.includes('Chromium');
}, []);

singlePeerConnection: supportsSinglePeerConnection

Result

After making this change:

  • Firefox ↔ Safari video interoperability appears to be working.

  • Edge users can see participant videos again.

  • Firefox video freeze issues have significantly reduced.

Questions

  1. Is singlePeerConnection currently considered fully production-ready across Chrome, Firefox, Safari, and Edge?

  2. Has anyone experienced similar Firefox/Safari/Edge interoperability issues when enabling singlePeerConnection globally?

  3. Is browser-based enablement/disablement of singlePeerConnection a reasonable production approach, or is there a better way to handle this?

  4. Are there known limitations with Safari publishing and Firefox subscribing when using a single PeerConnection?

  5. Would LiveKit recommend keeping singlePeerConnection disabled entirely for non-Chromium browsers until browser support matures further?

Any guidance or production experience from the community would be greatly appreciated.

Thanks!

1 Like

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.