Skip to content

Commit

Permalink
Workaround for Android. Via @astroza
Browse files Browse the repository at this point in the history
  • Loading branch information
muaz-khan committed Jan 30, 2015
1 parent 30d1a82 commit d5690e7
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 2 deletions.
14 changes: 13 additions & 1 deletion RecordRTC.js
Original file line number Diff line number Diff line change
Expand Up @@ -1129,7 +1129,7 @@ function MediaStreamRecorder(mediaStream) {
if (!self.disableLogs) {
console.warn(error);
}

// When the stream is "ended" set recording to 'inactive'
// and stop gathering data. Callers should not rely on
// exactness of the timeSlice value, especially
Expand Down Expand Up @@ -1963,6 +1963,12 @@ function WhammyRecorder(mediaStream) {

// via #206, by Jack i.e. @Seymourr
lastTime = new Date().getTime();

if(video.paused) {
// via: https://github.com/muaz-khan/WebRTC-Experiment/pull/316
// Tweak for Android Chrome
video.play();
}

context.drawImage(video, 0, 0, canvas.width, canvas.height);
whammy.frames.push({
Expand Down Expand Up @@ -2824,6 +2830,12 @@ function GifRecorder(mediaStream) {
if (time - lastFrameTime < 90) {
return;
}

if(video.paused) {
// via: https://github.com/muaz-khan/WebRTC-Experiment/pull/316
// Tweak for Android Chrome
video.play();
}

context.drawImage(video, 0, 0, canvas.width, canvas.height);

Expand Down
2 changes: 1 addition & 1 deletion RecordRTC.min.js

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions dev/GifRecorder.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,12 @@ function GifRecorder(mediaStream) {
return;
}

if (video.paused) {
// via: https://github.com/muaz-khan/WebRTC-Experiment/pull/316
// Tweak for Android Chrome
video.play();
}

context.drawImage(video, 0, 0, canvas.width, canvas.height);

if (self.onGifPreview) {
Expand Down
6 changes: 6 additions & 0 deletions dev/WhammyRecorder.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,12 @@ function WhammyRecorder(mediaStream) {
// via #206, by Jack i.e. @Seymourr
lastTime = new Date().getTime();

if (video.paused) {
// via: https://github.com/muaz-khan/WebRTC-Experiment/pull/316
// Tweak for Android Chrome
video.play();
}

context.drawImage(video, 0, 0, canvas.width, canvas.height);
whammy.frames.push({
duration: duration,
Expand Down

0 comments on commit d5690e7

Please sign in to comment.