CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-webrtc-adapter

A shim to insulate apps from WebRTC spec changes and browser prefix differences

Overall
score

98%

Overview
Eval results
Files

task.mdevals/scenario-2/

Video Call Application Media Handler

A module that provides cross-browser compatible media stream acquisition for a video conferencing application.

Capabilities

Acquires media streams with audio processing constraints

  • Requesting a video and audio stream with noise suppression enabled returns a MediaStream with both video and audio tracks. @test
  • Requesting an audio stream with automatic gain control enabled returns a MediaStream with an audio track that has AGC enabled. @test

Handles camera selection on mobile devices

  • Requesting a video stream with user-facing camera (front camera) returns a MediaStream with a video track from the front camera. @test
  • Requesting a video stream with environment-facing camera (rear camera) returns a MediaStream with a video track from the rear camera. @test

Handles permission errors consistently

  • When camera permission is denied, the error thrown has a consistent error name across browsers. @test
  • When microphone permission is denied, the error thrown has a consistent error name across browsers. @test

Implementation

@generates

API

/**
 * Requests media streams with the specified constraints.
 * Handles cross-browser compatibility for media acquisition.
 *
 * @param {Object} constraints - Media constraints object with audio and video properties
 * @param {boolean|Object} constraints.audio - Audio constraints or boolean
 * @param {boolean|Object} constraints.video - Video constraints or boolean
 * @returns {Promise<MediaStream>} A promise that resolves with a MediaStream
 * @throws {Error} Throws an error if permission is denied or constraints cannot be satisfied
 */
async function getMediaStream(constraints) {
  // IMPLEMENTATION HERE
}

module.exports = {
  getMediaStream
};

Dependencies { .dependencies }

webrtc-adapter { .dependency }

Provides cross-browser compatibility for WebRTC APIs including getUserMedia normalization.

@satisfied-by

Install with Tessl CLI

npx tessl i tessl/npm-webrtc-adapter

tile.json