From c63dc7a36198dad717a65dfffd106298b7a809ec Mon Sep 17 00:00:00 2001 From: llaske Date: Wed, 30 Aug 2017 15:57:39 +0200 Subject: [PATCH] Fix crash issue on Windows 10: no audio/video support in Edge --- .../Record.activity/js/capture-helper.js | 30 ++++++++++++------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/activities/Record.activity/js/capture-helper.js b/activities/Record.activity/js/capture-helper.js index e51c72b5e..70fddc209 100644 --- a/activities/Record.activity/js/capture-helper.js +++ b/activities/Record.activity/js/capture-helper.js @@ -676,9 +676,13 @@ define(["activity/recordrtc", "sugar-web/activity/activity", "sugar-web/datastor }; // start image capture - navigator.device.capture.captureAudio(captureSuccess, captureError, { - limit: 1 - }); + try { + navigator.device.capture.captureAudio(captureSuccess, captureError, { + limit: 1 + }); + } catch(err) + { + } }, recordVideo: function () { @@ -714,13 +718,17 @@ define(["activity/recordrtc", "sugar-web/activity/activity", "sugar-web/datastor }; // start image capture - navigator.device.capture.captureVideo(captureSuccess, captureError, { - limit: 1, - quality: 0, - duration: 15, - width: captureHelper.width, - height: captureHelper.height - }); + try { + navigator.device.capture.captureVideo(captureSuccess, captureError, { + limit: 1, + quality: 0, + duration: 15, + width: captureHelper.width, + height: captureHelper.height + }); + } catch(err) + { + } }, onDeviceReady: function () { @@ -734,4 +742,4 @@ define(["activity/recordrtc", "sugar-web/activity/activity", "sugar-web/datastor }; return captureHelper; -}); \ No newline at end of file +});