A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developer.mozilla.org/en-US/docs/Web/API/MediaStream/getTrackById below:

MediaStream: getTrackById() method - Web APIs

MediaStream: getTrackById() method

Baseline Widely available

The getTrackById() method of the MediaStream interface returns a MediaStreamTrack object representing the track with the specified ID string. If there is no track with the specified ID, this method returns null.

Syntax Parameters
id

A string which identifies the track to be returned.

Return value

If a track is found for which MediaStreamTrack.id matches the specified id string, that MediaStreamTrack object is returned. Otherwise, the returned value is null.

Examples

This example activates a commentary track on a video by ducking the audio level of the main audio track to 50%, then enabling the commentary track.

stream.getTrackById("primary-audio-track").applyConstraints({ volume: 0.5 });
stream.getTrackById("commentary-track").enabled = true;
Specifications Browser compatibility See also

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.3