Skip to content

Commit 4533284

Browse files
committed
Workaround for Android. Via @astroza
muaz-khan/WebRTC-Experiment#316
1 parent ff98f90 commit 4533284

File tree

4 files changed

+26
-2
lines changed

4 files changed

+26
-2
lines changed

RecordRTC.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1129,7 +1129,7 @@ function MediaStreamRecorder(mediaStream) {
11291129
if (!self.disableLogs) {
11301130
console.warn(error);
11311131
}
1132-
1132+
11331133
// When the stream is "ended" set recording to 'inactive'
11341134
// and stop gathering data. Callers should not rely on
11351135
// exactness of the timeSlice value, especially
@@ -1963,6 +1963,12 @@ function WhammyRecorder(mediaStream) {
19631963

19641964
// via #206, by Jack i.e. @Seymourr
19651965
lastTime = new Date().getTime();
1966+
1967+
if(video.paused) {
1968+
// via: https://github.com/muaz-khan/WebRTC-Experiment/pull/316
1969+
// Tweak for Android Chrome
1970+
video.play();
1971+
}
19661972

19671973
context.drawImage(video, 0, 0, canvas.width, canvas.height);
19681974
whammy.frames.push({
@@ -2824,6 +2830,12 @@ function GifRecorder(mediaStream) {
28242830
if (time - lastFrameTime < 90) {
28252831
return;
28262832
}
2833+
2834+
if(video.paused) {
2835+
// via: https://github.com/muaz-khan/WebRTC-Experiment/pull/316
2836+
// Tweak for Android Chrome
2837+
video.play();
2838+
}
28272839

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

RecordRTC.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dev/GifRecorder.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,12 @@ function GifRecorder(mediaStream) {
104104
return;
105105
}
106106

107+
if (video.paused) {
108+
// via: https://github.com/muaz-khan/WebRTC-Experiment/pull/316
109+
// Tweak for Android Chrome
110+
video.play();
111+
}
112+
107113
context.drawImage(video, 0, 0, canvas.width, canvas.height);
108114

109115
if (self.onGifPreview) {

dev/WhammyRecorder.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,12 @@ function WhammyRecorder(mediaStream) {
9090
// via #206, by Jack i.e. @Seymourr
9191
lastTime = new Date().getTime();
9292

93+
if (video.paused) {
94+
// via: https://github.com/muaz-khan/WebRTC-Experiment/pull/316
95+
// Tweak for Android Chrome
96+
video.play();
97+
}
98+
9399
context.drawImage(video, 0, 0, canvas.width, canvas.height);
94100
whammy.frames.push({
95101
duration: duration,

0 commit comments

Comments
 (0)