A shim to insulate apps from WebRTC spec changes and browser prefix differences
Overall
score
98%
A utility that detects WebRTC browser compatibility and reports available features after compatibility shims have been applied.
Build a WebRTC compatibility detector that analyzes the current browser environment and reports which WebRTC features are available. The tool should work across different browsers (Chrome, Firefox, Safari) and benefit from compatibility layers that automatically normalize browser differences.
Your implementation should:
The detector should work seamlessly across different browser environments, taking advantage of any compatibility shims that normalize WebRTC APIs.
detectWebRTCSupport() that returns a compatibility report objectbrowser: Browser name string (e.g., "chrome", "firefox", "safari")version: Browser version numberfeatures: Object with boolean values indicating feature availability
RTCPeerConnection: true if availablegetUserMedia: true if availableRTCSessionDescription: true if availableRTCIceCandidate: true if available@generates
/**
* Detects WebRTC feature availability in the current browser.
*
* @returns {Object} Compatibility report with browser info and feature availability
* @returns {string} return.browser - Browser name
* @returns {number} return.version - Browser version
* @returns {Object} return.features - Map of feature names to availability booleans
*/
function detectWebRTCSupport() {
// IMPLEMENTATION HERE
}
module.exports = {
detectWebRTCSupport
};detectWebRTCSupport() returns an object with browser, version, and features properties @testfeatures.RTCPeerConnection property is true when RTCPeerConnection is available (either natively or via shim) @testfeatures.getUserMedia property is true when navigator.mediaDevices.getUserMedia is available @testbrowser is a non-empty string and version is a positive number @testProvides cross-browser WebRTC compatibility by automatically applying browser-specific shims on import.
Install with Tessl CLI
npx tessl i tessl/npm-webrtc-adapterdocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10