Procházet zdrojové kódy

Add a note about the aspect ratio

customisations
alemart před 2 měsíci
rodič
revize
553b2e0a22
1 změnil soubory, kde provedl 5 přidání a 1 odebrání
  1. 5
    1
      docs/api/camera-source.md

+ 5
- 1
docs/api/camera-source.md Zobrazit soubor

@@ -17,6 +17,10 @@ Create a new webcam-based source of data with the specified `settings`.
17 17
     * `aspectRatio: number`. A hint specifying the preferred aspect ratio of the video.
18 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 24
 **Returns**
21 25
 
22 26
 A new webcam-based source of data.
@@ -39,4 +43,4 @@ const webcam = AR.Source.Camera({
39 43
 
40 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.

Načítá se…
Zrušit
Uložit