markp3rry
markp3rry

Reputation: 734

Launch camera from HTML 5 app running on Windows 8?

I've seen examples using XAML and writing some code in C# - is it possible just using Javascript?

Upvotes: 1

Views: 801

Answers (2)

Mihir Joshi
Mihir Joshi

Reputation: 818

You can write following method for launch camera

 function capturePhoto() {
   var capture = new Windows.Media.Capture.CameraCaptureUI();

    capture.captureFileAsync(Windows.Media.Capture.CameraCaptureUIMode.photo)


        .then(function (file) {
            if (file) {
                return file.openAsync(Windows.Storage.FileAccessMode.readWrite);
            }
        });

Upvotes: 0

Related Questions