Skip to content

[1.x] TrackOption.capture type does not support MediaStreamTrack #3573

@manupik

Description

@manupik

The TrackOption type should allow the capture property to accept a MediaStreamTrack, in addition to the existing options.

Current definition

type TrackOption = {
	// ...
	capture: boolean | MediaTrackConstraints;
	// ...
}

Suggested update

type TrackOption = {
	// ...
	capture: boolean | MediaTrackConstraints | MediaStreamTrack;
	// ...
}

Rationale
This is consistent with both the implementation and the documentation:

capture: in case something must be captured (e.g., a microphone for "audio" or a "webcam" for video), the capture property can be used to dictate what and how; passing true asks for the default device, but getUserMedia (for audio/video) or getDisplayMedia (for screen sharing) constraints can be passed as well as objects, and in case those will be used instead; passing a MediaStreamTrack instance will tell the library not to capture anything, but use the provided track as a source instead.
https://janus.conf.meetecho.com/docs/JS.html

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions