[BUG]: onProgress stream never completes, not sure if intended
See original GitHub issueFlutter sound onProgress stream never completes. Looking at the source, it seem to have been intended this way.
However I believe semantically speaking it should complete. It would allow things like this:
Stream<RecordingDisposition> record(String path) {
assert(_recorder.isStopped);
return Stream.fromFuture(_doRecord(path))
.switchMap((_) => _recorder.onProgress!)
.doOnDone(() => _closeRecorderSession());
}
Future<void> _doRecord(String path) async {
await _openRecorderSession();
await _recorder.setSubscriptionDuration(const Duration(milliseconds: 100));
await _recorder.startRecorder(
toFile: path,
codec: kIsWeb ? Codec.opusWebM : Codec.aacADTS,
);
}
It also has potential for unnecessary active subscriptions and might be the source of other bugs.
Issue Analytics
- State:
- Created 2 years ago
- Comments:12 (5 by maintainers)
Top Results From Across the Web
Media Source Extensions™ - W3C
Abstract. This specification extends HTMLMediaElement [ HTML ] to allow JavaScript to generate media streams for playback.
Read more >ProgressBar - Android Developers
Use indeterminate mode for the progress bar when you do not know how long an operation ... to increase the current progress completed...
Read more >1348087 - Use standard networking download code instead of ...
We assume that the download is complete at >+ * this point. ... Not sure what will need to be done to make...
Read more >Murphy's Laws - Cheap Thoughts
Murphy's Time-Action Quandary: You never know how soon is too late. ... Rahilly's Law of Academic Administration: Remember that not all the faculty...
Read more >Project Status Reports - ProjectManager
Reporting software can also be cloud-based, which means that it gathers data in real-time. No matter how fast you can manually calculate, you'll...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
How about returning a stream from the startRecord/startPlaying instead ? Or is that too much breaking change ?
I’m not sure what the lock is, if I understood correctly it’s to be sure the callback is executed only once at a time, if that’s the case then the way the progress is initialized is not entirely correct. his.
usage
Any update on this issue? Can we alternatively check if the player has completed playing the audio?