Advertisement
Guest User

Untitled

a guest
Jun 24th, 2019
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. 1.InvalidStateError: An attempt was made to use an object that is not, or is no longer,usable at function below
  2.  
  3. ***startRecordingnew()***
  4.  
  5. var recordButton, stopButton, recorder;
  6.  
  7.  
  8. window.onload = function () {
  9.  
  10. navigator.mediaDevices.getUserMedia({
  11. audio: true
  12. })
  13. .then(function (stream) {
  14. if (recorder == null) {
  15. recorder = new MediaRecorder(stream);
  16. alert(stream)
  17. recorder.addEventListener('dataavailable', onRecordingReady);
  18. }
  19. }).catch(function (err) {
  20. alert(err)
  21. });;
  22. };
  23.  
  24.  
  25. function startRecordingnew() {
  26.  
  27. recorder.start();
  28.  
  29. }
  30.  
  31. function stopRecordingnew() {
  32.  
  33. recorder.stop();
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement