Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
MSDN Library
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

CameraCaptureUIMode enumeration

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;

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 (Windows 10 device family)

Device family

Universal

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

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

Metadata

Windows.Foundation.UniversalApiContract.winmd

Capabilities

webcam
microphone

Requirements (Windows 8.x and Windows Phone 8.x)

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

Attributes

[Version(0x06020000)]

See also

CaptureFileAsync

 

 

Show:
© 2015 Microsoft