CameraCaptureUIMode enumeration

Applies to Windows only

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

[Version(0x06020000)]

Members

The CameraCaptureUIMode enumeration has these members.

MemberValueDescription
PhotoOrVideo | photoOrVideo0

Either a photo or video can be captured.

Photo | photo1

The user can only capture a photo.

Video | video2

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

Minimum supported phone

None supported

Namespace

Windows.Media.Capture
Windows::Media::Capture [C++]

Metadata

Windows.winmd

Capabilities

webcam
microphone

See also

CaptureFileAsync

 

 

Show:
© 2014 Microsoft