Skip to content

Commit

Permalink
Adding a wait just after recording (#289)
Browse files Browse the repository at this point in the history
  • Loading branch information
okaycj committed Feb 3, 2022
1 parent aac33fd commit dbb0abe
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions app/services/video-recorder.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,23 +234,23 @@ const VideoRecorder = Ember.Object.extend({
return null;
}
_this.get('recorder').record();
window.clearInterval(id); // stop trying - success

// Giving the "record" method a few seconds seems to increase the reliability of hooks firing.
setTimeout(function () {
window.clearInterval(id); // stop trying - success
}, 3000);

return null;
}, 100); // try every 100ms

return new Ember.RSVP.Promise((resolve) => {
return new Ember.RSVP.Promise((resolve, reject) => {
if (_this.get('recording')) {
resolve(this);
} else {
/*
This is to fix an issue where frame were freezing. If this is determined to be a
reasonable solution, then '_recordPromise' should be removed in other places.
*/
// _this.set('_recordPromise', {
// resolve,
// reject
// });
resolve();
_this.set('_recordPromise', {
resolve,
reject
});
}
});
},
Expand Down

0 comments on commit dbb0abe

Please sign in to comment.