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.

Issue : Start Player Freezes the app

See original GitHub issue

Flutter Sound Version : 7.8.4

When play button click flutter app freezes until audio starts playing. This is happening in only Android app, iOS app doesn’t freeze Can anyone provide the solution?

Start Player Code

Future<void> startPlayer(String url) async { try { if (url != null) { await _ChatState.playerModule.startPlayer( fromURI: url, codec: Codec.aacMP4, whenFinished: () { stopPlayer(); }); } } catch (err) { print('error: $err'); } }

Flutter Doctor

`[✓] Flutter (Channel unknown, 1.22.6, on Mac OS X 10.15.5 19F101 darwin-x64, locale en-GB) • Flutter version 1.22.6 at /Volumes/Workspace/Software/flutter • Framework revision 9b2d32b605 (8 months ago), 2021-01-22 14:36:39 -0800 • Engine revision 2f0af37152 • Dart version 2.10.5

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2) • Android SDK at /Users/pavans/Library/Android/sdk • Platform android-30, build-tools 30.0.2 • ANDROID_HOME = /Users/pavans/Library/Android/sdk • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495) • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 12.1) • Xcode at /Volumes/Workspace/Software/iOS/xCode/12.1/Xcode.app/Contents/Developer • Xcode 12.1, Build version 12A7403 • CocoaPods version 1.10.1

[✓] Android Studio (version 4.1) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin installed • Dart plugin version 201.9306 • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)

[✓] VS Code (version 1.60.0) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.25.0

[✓] Connected device (2 available)`

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:82

github_iconTop GitHub Comments

2reactions
Alvarocdacommented, Oct 11, 2021

Good news 🎉 I’ve managed to solve this problem 😄 Now, the app will not freeze with slow connections or no connection at all.

Now the bad news 😭 If the user does not have an internet connection, the lib will try to download the audio for approximately 40 seconds, the app will not freeze while this time passes, after these 40 seconds the app will go into a stopped state because it could not download. When it enters this state, the user cannot start the player again.

As far as I could figure out, the Lock on line 335 of the tau_sound/lib/public/tau_player.dart file is causing this issue of not letting the player start again.

If the user closes the player and opens it again, he is able to try to start the player again.

Well, anyway, I’m trying to solve this problem too.

1reaction
Larpouxcommented, Oct 11, 2021

OK. You are probably right. I am going to look that.

But just wait a little bit, I am actually busy releasing Flutter_Sound 8.4 and Tau_sound 9.0 (with your PullRequest included 😄 )

Read more comments on GitHub >

github_iconTop Results From Across the Web

Fix an Android device that freezes or won't respond
Try the following steps if your phone: Freezes Stops responding Is stuck with the screen on After each step, restart your phone to...
Read more >
If an app freezes or quits unexpectedly on Mac - Apple Support
If the app quit, reopen it by clicking Reopen in the dialog that appears. Restart your Mac by choosing Apple menu > Restart....
Read more >
Game crashes/freezes/slow (Android) - Awem Help Center
Open your device Settings > Apps & notifications > Cradle of Empires (If you don't see it, first tap See all apps or...
Read more >
Fixed: Computer Freezes When Playing Games in Windows 10
In this part, we'll list some quick tips to help you avoid and fix computer freeze issues while playing games on Windows 10/8/7....
Read more >
What do I do if my game crashes or freezes?
Close and re-open the game. Doing so can sometimes fix freezing and crash issues. · Close all other apps and restart your device...
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