Skip to content

Commit c63dc7a

Browse files
author
llaske
committed
Fix crash issue on Windows 10: no audio/video support in Edge
1 parent c991017 commit c63dc7a

File tree

1 file changed

+19
-11
lines changed

1 file changed

+19
-11
lines changed

activities/Record.activity/js/capture-helper.js

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -676,9 +676,13 @@ define(["activity/recordrtc", "sugar-web/activity/activity", "sugar-web/datastor
676676
};
677677

678678
// start image capture
679-
navigator.device.capture.captureAudio(captureSuccess, captureError, {
680-
limit: 1
681-
});
679+
try {
680+
navigator.device.capture.captureAudio(captureSuccess, captureError, {
681+
limit: 1
682+
});
683+
} catch(err)
684+
{
685+
}
682686
},
683687

684688
recordVideo: function () {
@@ -714,13 +718,17 @@ define(["activity/recordrtc", "sugar-web/activity/activity", "sugar-web/datastor
714718
};
715719

716720
// start image capture
717-
navigator.device.capture.captureVideo(captureSuccess, captureError, {
718-
limit: 1,
719-
quality: 0,
720-
duration: 15,
721-
width: captureHelper.width,
722-
height: captureHelper.height
723-
});
721+
try {
722+
navigator.device.capture.captureVideo(captureSuccess, captureError, {
723+
limit: 1,
724+
quality: 0,
725+
duration: 15,
726+
width: captureHelper.width,
727+
height: captureHelper.height
728+
});
729+
} catch(err)
730+
{
731+
}
724732
},
725733

726734
onDeviceReady: function () {
@@ -734,4 +742,4 @@ define(["activity/recordrtc", "sugar-web/activity/activity", "sugar-web/datastor
734742
};
735743

736744
return captureHelper;
737-
});
745+
});

0 commit comments

Comments
 (0)