Return-Path: X-Original-To: apmail-cordova-dev-archive@www.apache.org Delivered-To: apmail-cordova-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4ADEA18DF1 for ; Wed, 13 May 2015 17:34:33 +0000 (UTC) Received: (qmail 53398 invoked by uid 500); 13 May 2015 17:34:33 -0000 Delivered-To: apmail-cordova-dev-archive@cordova.apache.org Received: (qmail 53361 invoked by uid 500); 13 May 2015 17:34:33 -0000 Mailing-List: contact dev-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cordova.apache.org Delivered-To: mailing list dev@cordova.apache.org Received: (qmail 53349 invoked by uid 99); 13 May 2015 17:34:32 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 May 2015 17:34:32 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 89EB7DFFEF; Wed, 13 May 2015 17:34:32 +0000 (UTC) From: robpaveza To: dev@cordova.apache.org Reply-To: dev@cordova.apache.org References: In-Reply-To: Subject: [GitHub] cordova-plugin-camera pull request: CB-8879 fix stripe issue with ... Content-Type: text/plain Message-Id: <20150513173432.89EB7DFFEF@git1-us-west.apache.org> Date: Wed, 13 May 2015 17:34:32 +0000 (UTC) Github user robpaveza commented on a diff in the pull request: https://github.com/apache/cordova-plugin-camera/pull/94#discussion_r30254781 --- Diff: src/windows/CameraProxy.js --- @@ -337,28 +336,48 @@ function takePictureFromCameraWP(successCallback, errorCallback, args) { } }); - capture.initializeAsync(captureSettings).done(function () { - // msdn.microsoft.com/en-us/library/windows/apps/hh452807.aspx - capturePreview.msZoom = true; - capturePreview.src = URL.createObjectURL(capture); - capturePreview.play(); + captureSettings.photoCaptureSource = Windows.Media.Capture.PhotoCaptureSource.photo; - // Insert preview frame and controls into page - document.body.appendChild(capturePreview); - document.body.appendChild(captureCancelButton); + return capture.initializeAsync(captureSettings); + }).then(function () { + // msdn.microsoft.com/en-us/library/windows/apps/hh452807.aspx + capturePreview.msZoom = true; + capturePreview.src = URL.createObjectURL(capture); + capturePreview.play(); - // Bind events to controls - window.addEventListener('deviceorientation', cameraPreviewOrientation, false); - capturePreview.addEventListener('click', captureAction); - captureCancelButton.addEventListener('click', function () { - destroyCameraPreview(); - errorCallback('Cancelled'); - }, false); - }, function (err) { + // Insert preview frame and controls into page + document.body.appendChild(capturePreview); + document.body.appendChild(captureCancelButton); + + // Bind events to controls + window.addEventListener('deviceorientation', cameraPreviewOrientation, false); + capturePreview.addEventListener('click', captureAction); + captureCancelButton.addEventListener('click', function () { destroyCameraPreview(); - errorCallback('Camera intitialization error ' + err); - }); - }, errorCallback); + errorCallback('Cancelled'); + }, false); + + // Get available aspect ratios + var aspectRatios = getAspectRatios(capture); + + // Couldn't find a good ratio + if (aspectRatios.length === 0) { + destroyCameraPreview(); + errorCallback('There\'s not a good aspect ratio available'); + return; + } + + // Default aspect ratio 1.78 (16:9 hd video standard) + if (aspectRatios.indexOf("1.8") > -1) { --- End diff -- jshint rule violation: should be single quotes. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastructure@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org For additional commands, e-mail: dev-help@cordova.apache.org