question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

RecordRTC example (and other examples) doesn't work on iOS 12

See original GitHub issue

Expected Behavior

Record audio multiple times.

Current Behavior

Recording audio is possible only 4 times. On 5th try there is an alert with error.

Failure Information

null is not an object (evaluating 'context.createMediaStreamSource')

Steps to Reproduce

  1. Open https://www.webrtc-experiment.com/RecordRTC/ using iOS 12 (or any other example like https://www.webrtc-experiment.com/RecordRTC/simple-demos/audio-recording.html ).
  2. Use default recording parameters.
  3. Click on “Start recording” and “Stop recording” 4 times.
  4. On 5th try you will see an error.

Context

  • Operating System: iOS 12.1.4
  • Browser: latest Safari

Screenshot

2019-03-19 11-31-45

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:11

github_iconTop GitHub Comments

3reactions
alexbazilevcommented, May 13, 2019

@Tayyaba03 I went to PROJECT_FOLDER/node_modules/recordrtc/RecordRTC.js and applied this instead of lines 2879-2890 (RecordRTC version is 5.5.4):

if (typeof RecordRTC.Storage === 'undefined') {
        RecordRTC.Storage = {
            AudioContextConstructor: null,
            AudioContext: window.AudioContext || window.webkitAudioContext
        };
    }

    if (!RecordRTC.Storage.AudioContextConstructor || RecordRTC.Storage.AudioContextConstructor.state === 'closed') {
        RecordRTC.Storage.AudioContextConstructor = new RecordRTC.Storage.AudioContext();
    }

    var context = RecordRTC.Storage.AudioContextConstructor;

This is not a good approach, because there is also RecordRTC.min.js that may probably be used for production bundle creation. What is more, “npm install” command may remove these temporary changes. So it is better to use pull request directly (https://stackoverflow.com/questions/33181297/npm-install-from-github-pull-request) or wait @muaz-khan to update the library. But for my current development purpose it works like a charm.

3reactions
xcloareccommented, Apr 5, 2019

Hi everyone, I had exactly the same issue with my project.

@thaihau the example audio-recording.html mentioned by @alexbazilev use StereoAudioRecorder on Safari browser which is working well, except the context problem which is limiting the number of uses.

I managed to solve this by using RecordRTC.Storage within StereoAudioRecorder, so the audio context can be closed when calling RecordRTC.destroy().

I created a pull request for this : https://github.com/muaz-khan/RecordRTC/pull/504

Read more comments on GitHub >

github_iconTop Results From Across the Web

Audio+Video+Screen Recording using RecordRTC
I am using web RTC audio recorder. It works great on all browsers on PCs and all browsers on Android. It does not...
Read more >
Guide to WebRTC with Safari in the Wild (Chad Phillips)
Chad Phillips provides a detailed list of Safari caveats and gotcha's for WebRTC developers ranging from media capture, device management, ...
Read more >
180748 – Audio sometimes fail to capture in WebRTC
On an iPad, go to https://webrtc.github.io/samples/ 2. Select sample "Audio-only getUserMedia() output to local audio element" 3.
Read more >
Recording video in Safari using WebRTC or RecordRTC
It seems that safari doesn't support MediaRecorder by default, so we can't record video by using webRTC or RecordRTC .
Read more >
Media Capture and Streams - W3C
This specification does not specify any such cases, but other specifications using the MediaStream API may. One such example is the WebRTC ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found