Skip to content

Commit 856ced5

Browse files
committed
Update script.js
1 parent babcb2d commit 856ced5

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

script.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ navigator.mediaDevices.getUserMedia(
184184
function successCallback(stream) {
185185
console.log('getUserMedia() got stream: ', stream);
186186
window.stream = stream;
187-
187+
gumVideo.srcObject = stream;
188188
}
189189

190190
function errorCallback(error) {
@@ -216,7 +216,20 @@ function handleDataAvailable(event) {
216216
}
217217
}
218218

219+
function handleStop(event) {
220+
console.log('Recorder stopped: ', event);
221+
}
219222

223+
function toggleRecording() {
224+
if (recordButton.textContent === 'Start Recording') {
225+
startRecording();
226+
} else {
227+
stopRecording();
228+
recordButton.textContent = 'Start Recording';
229+
playButton.disabled = false;
230+
downloadButton.disabled = false;
231+
}
232+
}
220233

221234

222235
// The nested try blocks will be simplified when Chrome 47 moves to Stable

0 commit comments

Comments
 (0)