muaz-khan / RecordRTC

RecordRTC is WebRTC JavaScript library for audio/video as well as screen activity recording. It supports Chrome, Firefox, Opera, Android, and Microsoft Edge. Platforms: Linux, Mac and Windows.
https://www.webrtc-experiment.com/RecordRTC/
MIT License
6.52k stars 1.75k forks source link

Not Able to play the recorded video after stopping the record #493

Open harendrakarsh opened 5 years ago

harendrakarsh commented 5 years ago

I am working on an angular4+ project where I have to record video and play the recorded video at first I got window.URL.createObjectUrl deprecation error I fixed this by using "video.srcObject = stream" in place of " video.src = window.URL.createObjectURL(stream);" But now when I am stopping the recording I am getting error when executing the below function - "recordRTC.getDataURL(function (dataURL) { });"

"RecordRTC.js:265 Uncaught TypeError: Cannot set property 'onmessage' of undefined at Object.getDataURL (RecordRTC.js:265) at VideoComponent.webpackJsonp.../../../../../src/app/video/video.component.ts.VideoComponent.processVideo (video.component.ts:72) at MediaStreamRecorder._callback [as recordingCallback] (RecordRTC.js:177) at MediaRecorder.mediaRecorder.ondataavailable (RecordRTC.js:2161)"

If I am trying the same thing in angular2 project it is working fine but getting above error with angular4+ projects

Someone please suggest how I can fix this issue so that I can play the recorded video

danouche93 commented 4 years ago

did you find a solution @harendrakarsh ?