-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Description
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:
-
Code reference:
janus-gateway/html/demos/janus.js
Line 2484 in 90677e2
// An external track was provided, use that -
Documentation excerpt:
capture
: in case something must be captured (e.g., a microphone for "audio" or a "webcam" for video), thecapture
property can be used to dictate what and how; passingtrue
asks for the default device, butgetUserMedia
(for audio/video) orgetDisplayMedia
(for screen sharing) constraints can be passed as well as objects, and in case those will be used instead; passing aMediaStreamTrack
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