Skip to content

Commit

Permalink
Merge pull request #17 from PhilLab/patch-1
Browse files Browse the repository at this point in the history
Fixing missing WhammyRecorder
  • Loading branch information
muaz-khan committed Oct 21, 2014
2 parents de84c33 + 9747e88 commit ef373f7
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions MediaStreamRecorder-standalone.js
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,39 @@ function WhammyRecorderHelper(mediaStream, root) {
var self = this;
}

// =================
// WhammyRecorder.js

function WhammyRecorder(mediaStream) {
// void start(optional long timeSlice)
// timestamp to fire "ondataavailable"
this.start = function(timeSlice) {
timeSlice = timeSlice || 1000;

mediaRecorder = new WhammyRecorderHelper(mediaStream, this);

mediaRecorder.record();

timeout = setInterval(function() {
mediaRecorder.requestData();
}, timeSlice);
};

this.stop = function() {
if (mediaRecorder) {
mediaRecorder.stop();
clearTimeout(timeout);
}
};

this.ondataavailable = function() {
};

// Reference to "WhammyRecorder" object
var mediaRecorder;
var timeout;
}

// Muaz Khan - https://github.com/muaz-khan
// neizerth - https://github.com/neizerth
// MIT License - https://www.webrtc-experiment.com/licence/
Expand Down

0 comments on commit ef373f7

Please sign in to comment.