Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Permitir controle de configurações do streaming #5

Open
guiseek opened this issue Oct 12, 2021 · 1 comment
Open

Permitir controle de configurações do streaming #5

guiseek opened this issue Oct 12, 2021 · 1 comment

Comments

@guiseek
Copy link
Owner

guiseek commented Oct 12, 2021

Atualmente só é permitido utilizar informações do dispositivo de entrada via localStorage, como está na referência abaixo.

audio = { deviceId };

seria 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 em localStorage, 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 o deviceId.

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

@guiseek
Copy link
Owner Author

guiseek commented Oct 12, 2021

MediaStreamConstraints

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.

MediaTrackConstraints

Audio

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.

Video

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant