(mediaStream)
| 1373 | // StereoAudioRecorder.js |
| 1374 | |
| 1375 | function StereoAudioRecorder(mediaStream) { |
| 1376 | // void start(optional long timeSlice) |
| 1377 | // timestamp to fire "ondataavailable" |
| 1378 | this.start = function(timeSlice) { |
| 1379 | timeSlice = timeSlice || 1000; |
| 1380 | |
| 1381 | mediaRecorder = new StereoAudioRecorderHelper(mediaStream, this); |
| 1382 | |
| 1383 | mediaRecorder.record(); |
| 1384 | |
| 1385 | timeout = setInterval(function() { |
| 1386 | mediaRecorder.requestData(); |
| 1387 | }, timeSlice); |
| 1388 | }; |
| 1389 | |
| 1390 | this.stop = function() { |
| 1391 | if (mediaRecorder) { |
| 1392 | mediaRecorder.stop(); |
| 1393 | clearTimeout(timeout); |
| 1394 | this.onstop(); |
| 1395 | } |
| 1396 | }; |
| 1397 | |
| 1398 | this.pause = function() { |
| 1399 | if (!mediaRecorder) { |
| 1400 | return; |
| 1401 | } |
| 1402 | |
| 1403 | mediaRecorder.pause(); |
| 1404 | }; |
| 1405 | |
| 1406 | this.resume = function() { |
| 1407 | if (!mediaRecorder) { |
| 1408 | return; |
| 1409 | } |
| 1410 | |
| 1411 | mediaRecorder.resume(); |
| 1412 | }; |
| 1413 | |
| 1414 | this.ondataavailable = function() {}; |
| 1415 | this.onstop = function() {}; |
| 1416 | |
| 1417 | // Reference to "StereoAudioRecorder" object |
| 1418 | var mediaRecorder; |
| 1419 | var timeout; |
| 1420 | } |
| 1421 | |
| 1422 | if (typeof MediaStreamRecorder !== 'undefined') { |
| 1423 | MediaStreamRecorder.StereoAudioRecorder = StereoAudioRecorder; |
nothing calls this directly
no outgoing calls
no test coverage detected