You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

WebRTC单向视频通话异常:Chrome 65协商问题排查求助

Troubleshooting Chrome 65 WebRTC Negotiation Issues

Hey there, let's break down this tricky Chrome 65 WebRTC negotiation problem you're facing—since you're unsure if it's a spec feature or your implementation, let's start with the most likely culprits tied to that specific Chrome version:

Common Chrome 65-Specific Quirks

Chrome 65 was released back in 2018, and its WebRTC stack had a few known edge-case issues around media constraints and SDP negotiation. Here are the top things to check:

1. Empty Media Stream Handling

If users choose to disable both audio and video, Chrome 65 had trouble negotiating offers with no media tracks. Unlike newer Chrome versions, it often failed to generate valid SDP when getUserMedia() was called with {audio: false, video: false}.

To test this:

  • Print the generated Offer SDP (use offer.sdp) and check for m= lines. If there are no m=audio or m=video entries, that's the problem—Chrome 65 expects at least one media type to exist in the SDP, even if it's marked as inactive.

2. Media Constraints vs. SDP Negotiation Timing

Double-check that you're only creating the RTCPeerConnection offer after the getUserMedia() promise resolves. Chrome 65 was stricter about timing here—if you tried to generate an offer before the media stream was fully initialized (or before confirming no streams would be used), the negotiation could fail silently.

For example, avoid code like this:

// Risky in Chrome 65
const pc = new RTCPeerConnection();
pc.createOffer().then(offer => pc.setLocalDescription(offer));
getUserMedia({audio: false, video: false}).then(stream => { /* ... */ });

Instead, ensure createOffer() runs after handling the media stream (or lack thereof):

// Safer approach
getUserMedia(constraints).then(stream => {
  const pc = new RTCPeerConnection();
  // Add tracks if available, or proceed with empty stream logic
  stream.getTracks().forEach(track => pc.addTrack(track, stream));
  return pc.createOffer();
}).then(offer => {
  // Continue negotiation flow
});

3. Incorrect Media Constraint Format

Make sure your constraints are explicitly setting audio/video to false when users opt out. Chrome 65 didn't handle omitted constraint keys well—for example, if you passed {video: true} without an audio key, it might default to audio: true unexpectedly, causing a mismatch between user selection and the SDP generated.

How to Verify If It's a Chrome 65 Bug

  • Test the exact same logic in a newer Chrome version (e.g., Chrome 100+). If negotiation works as expected there, it's almost certainly a Chrome 65-specific bug.
  • Chrome 66+ addressed several empty media stream negotiation issues, so this behavior was likely fixed in subsequent releases.

Potential Fixes

  • If users need to call without media, adjust your logic to include a dummy media track marked as inactive, or prompt users to enable at least one media type (audio or video) for calls.
  • Ensure all getUserMedia() calls resolve before initiating peer connection negotiation.
  • Explicitly set both audio and video keys in your MediaConstraints, even if they're set to false.

内容的提问来源于stack exchange,提问作者Sven Eppler

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.25 08:26:55