flutter-webrtc icon indicating copy to clipboard operation
flutter-webrtc copied to clipboard

MediaRecorder.startWeb() should expose the timeslice parameter

Open noinskit opened this issue 2 years ago • 1 comments

Is your feature request related to a problem? Please describe. I'm trying to use flutter-webrtc to get a stream of audio from local microphone, in real time. I'm using MediaRecorder.startWeb(), but the onDataChunk is simply not firing until the stream closes.

Describe the solution you'd like I'd like to be able to specify timeslice in which I could get audio samples in real time. It's part of MediaRecorder API: https://developer.mozilla.org/en-US/docs/Web/API/MediaRecorder/start

I actually tried modifying media_recorder_impl.dart in package dart_webrtc to change the line: _recorder.start(); to: _recorder.start(10);

...and it worked great! The callback started firing.

noinskit avatar Mar 16 '22 22:03 noinskit

EXAMPLE https://github.com/flutter-webrtc/flutter-webrtc/tree/main/example/lib

web :- void _startRecording() async { _mediaRecorder = MediaRecorder(); setState(() {}); _mediaRecorder?.startWeb(_localStream!); }

in Desktop browser work if run app in mobile browser its not work .. For fix the issue Work To - web -
Direct {..integration..} with Dart.html Recorder

ghost avatar Aug 25 '22 20:08 ghost