-
-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Channels and platform threading error #30
Comments
I'm getting the same error. If i try the audioplayers, the same error appears, simply with a different channel name. |
Please provide a reproducible snippet. Make sure you are not calling the plugin from any isolate other than the main thread. |
A reproducible snippet from me: class _MyStatefulWidgetState extends State<MyStatefulWidget> {
@override
initState() {
super.initState();
playWidgetSound();
}
playWidgetSound() async {
//Player is global variable
player.setAsset(songPath);
player.play();
}
@override
Widget build(BuildContext context){
//Rest of the code
} |
What is the value of just_audio_windows/just_audio_background/example/lib/main.dart Lines 63 to 72 in d97eb5b
|
The value of songPath is |
You need to add
|
Ok, the problem has been solved for me. Thank you very much. |
final AudioPlayer player = AudioPlayer();
duration = await player.setUrl(urlFile, preload: false);
player.play(); |
@mbfakourii what is the value of |
|
same error |
Are there any updates here? I get the same error on very first play, then it works as expected:
On mobile it works as expected. Flutter version
|
There is this issue with Flutter plug-ins on Windows. It happens with a few packages and have been known to be just a warning. As some have reported above, the audio plays even with the error printed. Note that this doesn't happen on all devices and not even all the time, which makes it hard to track and debug. |
the funny thing is that audio_player library have the same issue |
same error |
Which API doesn't behave as documented, and how does it misbehave?
When the audio tries to play, the following error is given
Minimal reproduction project
n/a
To Reproduce (i.e. user steps, not code)
n/a
Expected behavior
I expected the sound to be played and not error
Screenshots
n/a
Desktop (please complete the following information):
Smartphone (please complete the following information):
Flutter SDK version
Additional context
n/a
The text was updated successfully, but these errors were encountered: