Skip to content

Commit ef373f7

Browse files
committed
Merge pull request streamproc#17 from PhilLab/patch-1
Fixing missing WhammyRecorder
2 parents de84c33 + 9747e88 commit ef373f7

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

MediaStreamRecorder-standalone.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -560,6 +560,39 @@ function WhammyRecorderHelper(mediaStream, root) {
560560
var self = this;
561561
}
562562

563+
// =================
564+
// WhammyRecorder.js
565+
566+
function WhammyRecorder(mediaStream) {
567+
// void start(optional long timeSlice)
568+
// timestamp to fire "ondataavailable"
569+
this.start = function(timeSlice) {
570+
timeSlice = timeSlice || 1000;
571+
572+
mediaRecorder = new WhammyRecorderHelper(mediaStream, this);
573+
574+
mediaRecorder.record();
575+
576+
timeout = setInterval(function() {
577+
mediaRecorder.requestData();
578+
}, timeSlice);
579+
};
580+
581+
this.stop = function() {
582+
if (mediaRecorder) {
583+
mediaRecorder.stop();
584+
clearTimeout(timeout);
585+
}
586+
};
587+
588+
this.ondataavailable = function() {
589+
};
590+
591+
// Reference to "WhammyRecorder" object
592+
var mediaRecorder;
593+
var timeout;
594+
}
595+
563596
// Muaz Khan - https://github.com/muaz-khan
564597
// neizerth - https://github.com/neizerth
565598
// MIT License - https://www.webrtc-experiment.com/licence/

0 commit comments

Comments
 (0)