Determines whether the user interface for capturing from the attached camera allows capture of photos, videos, or both photos and videos.
Syntax
var value = Windows.Media.Capture.CameraCaptureUIMode.photoOrVideo;
Attributes
- VersionAttribute(NTDDI_WIN8)
Members
The CameraCaptureUIMode enumeration has these members.
| Member | Value | Description |
|---|---|---|
| PhotoOrVideo | photoOrVideo | 0 |
Either a photo or video can be captured. |
| Photo | photo | 1 |
The user can only capture a photo. |
| Video | video | 2 |
The user can only capture a video. |
Examples
In the following example, the user interface allows the user to capture a video.
// Captures a video using the default settings. function takeVideo() { var captureUI = new Windows.Media.Capture.CameraCaptureUI(); captureUI.captureFileAsync(Windows.Media.Capture.CameraCaptureUIMode.video).then(function (file) { if (file) { document.getElementById("message").innerHTML = "User captured a video." } else { document.getElementById("message").innerHTML = "User didn't capture a video." } }); }
In the following example, the user interface allows the user to take a photo.
// Take a photo using the default JPEG format. function takepicture() { var captureUI = new Windows.Media.Capture.CameraCaptureUI(); captureUI.captureFileAsync(Windows.Media.Capture.CameraCaptureUIMode.photo).then(function (capturedItem) { if (capturedItem) { document.getElementById("message").innerHTML = "User captured a photo." } else { document.getElementById("message").innerHTML = "User didn't capture a photo." } }); }
Requirements
|
Minimum supported client | Windows 8 |
|---|---|
|
Minimum supported server | Windows Server 2012 |
|
Namespace |
|
|
Metadata |
|
|
Capabilities |
|
See also
Build date: 12/4/2012