Skip to content

Commit

Permalink
Fix crash issue on Windows 10: no audio/video support in Edge
Browse files Browse the repository at this point in the history
  • Loading branch information
llaske committed Aug 30, 2017
1 parent c991017 commit c63dc7a
Showing 1 changed file with 19 additions and 11 deletions.
30 changes: 19 additions & 11 deletions activities/Record.activity/js/capture-helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand Down Expand Up @@ -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 () {
Expand All @@ -734,4 +742,4 @@ define(["activity/recordrtc", "sugar-web/activity/activity", "sugar-web/datastor
};

return captureHelper;
});
});

0 comments on commit c63dc7a

Please sign in to comment.