[bug] Hot Restart
See original GitHub issueThe app uses FlutterSoundPlayer singleton to play audio. When it is hot restart app, the program will crash.
when call await playerModule.openAudioSession() in iOS, program will crash。 but It’s good on Android
FlutterSoundPlayer playerModule = FlutterSoundPlayer();
bool _isMute = false;
bool _isPlayInited = false;
static SoundManager _getInstance() {
if (_instance == null) {
_instance = new SoundManager._internal();
}
return _instance;
}
SoundManager._internal() {
initAudioPlay();
}
Future<void> initAudioPlay() async {
try {
await playerModule.openAudioSession(
focus: AudioFocus.requestFocusAndStopOthers,
category: SessionCategory.playAndRecord);
await playerModule.setSubscriptionDuration(Duration(milliseconds: 100));
_isPlayInited = true;
return Future.value(true);
} catch(e){
return Future.value(false);
}
}
Issue Analytics
- State:
- Created 3 years ago
- Comments:9
Top Results From Across the Web
Hot Reload Stopped Working after Hot Restart #3511 - GitHub
Describe the bug. Flutter Hot Reload function has stopped working in the lastest Dart Code v3. · Steps to reproduce the behavior: ·...
Read more >Hot reload - Flutter documentation
Flutter's hot reload feature helps you quickly and easily experiment, build UIs, add features, and fix bugs. Hot reload works by injecting updated...
Read more >Difference Between Hot Reload and Hot Restart in Flutter
Hot Reload allows us to see the reflected change after bug fixes, building User interfaces and even adding certain features to the app...
Read more >Hot Reload of .NET 6 & Visual Studio 2022 in (buggy) action ...
NET Jumpstart Course: https://www.udemy.com/course/net-core-31-web-api-entity-framework-core-jumpstart/?referralCode=CA390CA392FF8B003518 ...
Read more >Hot reload bug? : r/sveltejs - Reddit
I'm having an issue with the hot reload feature. I used svelte-add to load tailwinds. I have a couple modules in /src/lib that...
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
Several Flutter Sound users complained about that.
There is really something wrong in Flutter Sound. @bsutton investigated this and found the solution but he does not want to work anymore with us 👎 .
Registered in the Flutter Sound Project
Fixed in Flutter Sound release 7.6.3