FlutterFlow / flutterflow-issues

A community issue tracker for FlutterFlow.
129 stars 26 forks source link

Use many audioplayer controls crash the app and all audio players stop working #2887

Open JaimeNuup opened 6 months ago

JaimeNuup commented 6 months ago

Has your issue been reported?

Current Behavior

In my project I use many audioplayer widgets but, when I play 30 or 40 audio files the audioplayer widgets stop working, I downloaded the code and ran it to try a debug and I observed that when an audioplayer widget is used a process is generated and it is preserved despite already being on another screen so they accumulate and when 30 to 40 processes are reached the application It stops working. the The solution (maybe) ,and for now function for me but is a very time consuming is put manually a code for dispose every process, as example: _model.soundPlayer21?.dispose();

I hope this information help to resolve the bug soon.

Thanks a lot

Jaime

Expected Behavior

FlutterFlow must generate automatically the code for dispose the _model.soundPlayer or audioPlayer process and avoid the audio crashs or unespected app stop without warnings or error.

Steps to Reproduce

1 Create an app with 10 pages every with 10 audioplayer widgets 2 Run the app in a virtual phone or real device 3 Play the 10 audio files in every page 4 In some time the audio stop playing at all withot error or warning 5 if the app is restored all function well again before reach 30 or 40 process.

Reproducible from Blank

Bug Report Code (Required)

IT48l8j6w5NOm99c+Kr2dvpaniAXHDI7U+YZiO5TYxA8J5zKB+wAYvf7P1FWTL3hTGw7e2H8hnMe/Pfqiuz9G+0DNRKtf4g9+sx6VQ6VczuRb7aYPKq3fW1QTPNXC0izyJ+42xJ/NsxvL2dgw1+IftyRcBPDQZD1OTI/MfmbLdeK2SrDX1iXc2URm05KZDPz

Context

I ned to develop an app to learn a new languaje with many audio files and not working at all because frecuent crashes.

Visual documentation

https://github.com/FlutterFlow/flutterflow-issues/assets/169478796/191ef9bd-e5a0-44b9-a2b1-1e7017472b4b

Additional Info

No response

Environment

- FlutterFlow version: 4.1.49+
- Platform: Android
- Browser name and version: No browser is an app
- Operating system and version affected: All android versions

General

Relative to the time the changes were made, data was lost within

When following my steps to reproduce, data loss happens

msusviela commented 6 months ago

I was able to reproduce the issue, I will send it to the ENG team so they can work on this!

JaimeNuup commented 6 months ago

Excelent, by the way i can say that I "resolve" the problem add two code sentences manually by every soundPlayer. I used.

_model.soundPlayer1?.dispose(); _model.soundPlayer1 = null; _model.soundPlayer2?.dispose(); _model.soundPlayer2 = null; _model.soundPlayer3?.dispose(); _model.soundPlayer3 = null; _model.soundPlayerX?.dispose(); _model.soundPlayerX = null;

And so on, becouse FlutterFlow generate the code for "just_audio" and instantiate by AudioPlayer() sentence, but don't create the code to dispose the objects created.

Thanks

JaimeNuup commented 5 months ago

Is there any progress?