1
//// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
2
//// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
3
//// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
4
//// PARTICULAR PURPOSE.
6
//// Copyright (c) Microsoft Corporation. All rights reserved
12
var sampleTitle = "OpenCV Image Manipulations sample";
15
{ url: "/html/AdvancedCapture.html", title: "Enumerate cameras and add a video effect" },
18
function activated(eventObject) {
19
if (eventObject.detail.kind === Windows.ApplicationModel.Activation.ActivationKind.launch) {
20
// Use setPromise to indicate to the system that the splash screen must not be torn down
21
// until after processAll and navigate complete asynchronously.
22
eventObject.setPromise(WinJS.UI.processAll().then(function () {
23
// Navigate to either the first scenario or to the last running scenario
24
// before suspension or termination.
25
var url = WinJS.Application.sessionState.lastUrl || scenarios[0].url;
26
return WinJS.Navigation.navigate(url);
31
WinJS.Navigation.addEventListener("navigated", function (eventObject) {
32
var url = eventObject.detail.location;
33
var host = document.getElementById("contentHost");
34
// Call unload method on current scenario, if there is one
35
host.winControl && host.winControl.unload && host.winControl.unload();
36
WinJS.Utilities.empty(host);
37
eventObject.detail.setPromise(WinJS.UI.Pages.render(url, host, eventObject.detail.state).then(function () {
38
WinJS.Application.sessionState.lastUrl = url;
42
WinJS.Namespace.define("SdkSample", {
43
sampleTitle: sampleTitle,
45
mediaCaptureMgr: null,
46
photoFile: "photo.jpg",
49
captureInitSettings: null,
50
encodingProfile: null,
53
cameraControlSliders: null,
56
displayStatus: function (statusText) {
57
WinJS.log && WinJS.log(statusText, "MediaCapture", "status");
60
displayError: function (error) {
61
WinJS.log && WinJS.log(error, "MediaCapture", "error");
64
id: function (elementId) {
65
return document.getElementById(elementId);
70
WinJS.Application.addEventListener("activated", activated, false);
71
WinJS.Application.start();
72
Windows.UI.WebUI.WebUIApplication.addEventListener("suspending", SdkSample.suspendingHandler, false);
73
Windows.UI.WebUI.WebUIApplication.addEventListener("resuming", SdkSample.resumingHandler, false);