Ver código fonte

Add a note about the aspect ratio

customisations
alemart 2 meses atrás
pai
commit
553b2e0a22
1 arquivos alterados com 5 adições e 1 exclusões
  1. 5
    1
      docs/api/camera-source.md

+ 5
- 1
docs/api/camera-source.md Ver arquivo

17
     * `aspectRatio: number`. A hint specifying the preferred aspect ratio of the video.
17
     * `aspectRatio: number`. A hint specifying the preferred aspect ratio of the video.
18
     * `constraints: MediaTrackConstraints`. Additional video constraints that will be passed to `navigator.mediaDevices.getUserMedia()`.
18
     * `constraints: MediaTrackConstraints`. Additional video constraints that will be passed to `navigator.mediaDevices.getUserMedia()`.
19
 
19
 
20
+!!! tip "Landscape × Portrait"
21
+
22
+    You generally do not need to specify an `aspectRatio`, as encantar.js uses a suitable default. When customizing this setting, pick standard values for landscape mode such as `16/9` or `4/3`. Pick such values even if mobile devices are expected to be in portrait mode. Using arbitrary numbers is discouraged and may produce unexpected results in different devices.
23
+
20
 **Returns**
24
 **Returns**
21
 
25
 
22
 A new webcam-based source of data.
26
 A new webcam-based source of data.
39
 
43
 
40
 `source.resolution: Resolution, read-only`
44
 `source.resolution: Resolution, read-only`
41
 
45
 
42
-The [resolution](resolution.md) of this source of data. Set it when [instantiating](#instantiation) the object.
46
+The [resolution](resolution.md) of this source of data. Set it when [instantiating](#instantiation) the object.

Carregando…
Cancelar
Salvar