From 754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sun, 7 Apr 2024 13:41:34 -0500 Subject: new repository --- devdocs/html/attributes%2Fcapture.html | 80 ++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 devdocs/html/attributes%2Fcapture.html (limited to 'devdocs/html/attributes%2Fcapture.html') diff --git a/devdocs/html/attributes%2Fcapture.html b/devdocs/html/attributes%2Fcapture.html new file mode 100644 index 00000000..47a7979e --- /dev/null +++ b/devdocs/html/attributes%2Fcapture.html @@ -0,0 +1,80 @@ +

HTML attribute: capture

+

The capture attribute specifies that, optionally, a new file should be captured, and which device should be used to capture that new media of a type defined by the accept attribute.

Values include user and environment. The capture attribute is supported on the file input type.

The capture attribute takes as its value a string that specifies which camera to use for capture of image or video data, if the accept attribute indicates that the input should be of one of those types.

Value Description
user The user-facing camera and/or microphone should be used.
environment The outward-facing camera and/or microphone should be used

Note: Capture was previously a Boolean attribute which, if present, requested that the device's media capture device(s) such as camera or microphone be used instead of requesting a file input.

+
+

Try it

+
+

Examples

+
+

When set on a file input type, operating systems with microphones and cameras will display a user interface allowing the selection from an existing file or the creating of a new one.

+

html

+
<p>
+  <label for="soundFile">What does your voice sound like?:</label>
+  <input type="file" id="soundFile" capture="user" accept="audio/*" />
+</p>
+<p>
+  <label for="videoFile">Upload a video:</label>
+  <input type="file" id="videoFile" capture="environment" accept="video/*" />
+</p>
+<p>
+  <label for="imageFile">Upload a photo of yourself:</label>
+  <input type="file" id="imageFile" capture="user" accept="image/*" />
+</p>
+
+
+
+ + +

Note these work better on mobile devices; if your device is a desktop computer, you'll likely get a typical file picker.

+
+

Specifications

+
+ + +
Specification
HTML Media Capture
# dfn-capture
+

Browser compatibility

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariWebView AndroidChrome AndroidFirefox for AndroidOpera AndroidSafari on IOSSamsung Internet
captureNoNoNoNoNoNo4.4257914101.5
+

See also

+
+

+ © 2005–2023 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
+ https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/capture +

+
-- cgit v1.2.3