Open guiseek opened 3 years ago
video
é do tipo boolean
ou MediaTrackConstraints
, sendo padrão como false
Se verdadeiro, ele solicita que o MediaStream retornado contenha uma trilha de vídeo. Se uma estrutura de restrições for fornecida, ela especifica ainda mais a natureza e as configurações da trilha de vídeo. Se for false
, o MediaStream
NÃO DEVE conter uma trilha de vídeo.
audio
é do tipo booleano
ou MediaTrackConstraints
, assumindo como padrão false
Se verdadeiro, ele solicita que o MediaStream retornado contenha uma faixa de áudio. Se uma estrutura de restrições for fornecida, ela especifica ainda mais a natureza e as configurações da faixa de áudio. Se for false
, o MediaStream
NÃO DEVE conter uma faixa de áudio.
Property Name | Values | Notes |
---|---|---|
deviceId | DOMString | The identifier of the device generating the content of the MediaStreamTrack. It conforms with the definition of MediaDeviceInfo.deviceId. Note that the setting of this property is uniquely determined by the source that is attached to the MediaStreamTrack. In particular, getCapabilities() will return only a single value for deviceId. This property can therefore be used for initial media selection with getUserMedia(). However, it is not useful for subsequent media control with applyConstraints(), since any attempt to set a different value will result in an unsatisfiable ConstraintSet. If a string of length 0 is used as a deviceId value constraint with getUserMedia(), it MAY be interpreted as if the constraint is not specified. |
groupId | DOMString | The document-unique group identifier for the device generating the content of the MediaStreamTrack. It conforms with the definition of MediaDeviceInfo.groupId. Note that the setting of this property is uniquely determined by the source that is attached to the MediaStreamTrack. In particular, getCapabilities() will return only a single value for groupId. Since this property is not stable between browsing sessions, its usefulness for initial media selection with getUserMedia() is limited. It is not useful for subsequent media control with applyConstraints(), since any attempt to set a different value will result in an unsatisfiable ConstraintSet. |
Property Name | Values | Notes |
---|---|---|
width | ConstrainULong | The width or width range, in pixels. As a capability, the range should span the video source's pre-set width values with min being equal to 1 and max being the largest width. The User Agent MUST support downsampling to any value between the min width range value and the native resolution width. |
height | ConstrainULong | The height or height range, in pixels. As a capability, the range should span the video source's pre-set height values with min being equal to 1 and max being the largest height. The User Agent MUST support downsampling to any value between the min height range value and the native resolution height. |
frameRate | ConstrainDouble | The exact frame rate (frames per second) or frame rate range. If video source's pre-set can determine frame rate values, the range, as a capacity, should span the video source's pre-set frame rate values with min being equal to 0 and max being the largest frame rate. The User Agent MUST support frame rates obtained from integral decimation of the native resolution frame rate. If this frame rate cannot be determined (e.g. the source does not natively provide a frame rate, or the frame rate cannot be determined from the source stream), then this value MUST refer to the User Agent's vsync display rate. |
aspectRatio | ConstrainDouble | The exact aspect ratio (width in pixels divided by height in pixels, represented as a double rounded to the tenth decimal place) or aspect ratio range. |
facingMode | ConstrainDOMString | This string (or each string, when a list) should be one of the members of VideoFacingModeEnum. The members describe the directions that the camera can face, as seen from the user's perspective. Note that getConstraints may not return exactly the same string for strings not in this enum. This preserves the possibility of using a future version of WebIDL enum for this property. |
resizeMode | ConstrainDOMString | This string (or each string, when a list) should be one of the members of VideoResizeModeEnum. The members describe the means by which the resolution can be derived by the UA. In other words, whether the UA is allowed to use cropping and downscaling on the camera output.The UA MAY disguise concurrent use of the camera, by cropping and/or downscaling to mimic native resolutions when "none" is used, but only when the camera is in use in another browsing context.Note that getConstraints may not return exactly the same string for strings not in this enum. This preserves the possibility of using a future version of WebIDL enum for this property. |
Atualmente só é permitido utilizar informações do dispositivo de entrada via
localStorage
, como está na referência abaixo. https://github.com/guiseek/webrtc/blob/c58dd2bb54968a5c920722a0420fc7bf59e6f849/libs/adapters/src/lib/peer.impl.ts#L85seria interessante permitir que outras configurações, como tamanho da imagem , cancelamento de eco , dispositivo de saída e outras pudessem ser controladas também. tudo isso é controlável através de um objeto JSON relativamente simples, que poderia ser criado a partir de um
form
, tendo cada propriedade da configuração, um controle responsável, sendo eles salvos emlocalStorage
, e então a alteração nas linhas 85 e 89 usariam estes dados do storage como objeto de configuração e não somente odeviceId
.As possibilidades de configuração da API MediaStream estão aqui nesta spec: https://www.w3.org/TR/mediacapture-streams/#dom-mediastreamconstraints
Posso ajudar em dúvidas