Skip to content
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

windows [v1 rc2]: play function on remote freeze UI #1118

Closed
poka-IT opened this issue May 6, 2022 · 6 comments · Fixed by #1469
Closed

windows [v1 rc2]: play function on remote freeze UI #1118

poka-IT opened this issue May 6, 2022 · 6 comments · Fixed by #1469
Labels
bug platform-windows Affects the windows platform

Comments

@poka-IT
Copy link

poka-IT commented May 6, 2022

The play function may be async, but it still freezes the UI until play start.

Full Description
When a widget call play function of a player instance, with a remote source, this is freezing the UI until the song start to play.
This should not happen as this function is async.
This mean I can't scroll in listview, move the window or click anywere in app until the playing start.
Tried with await or not, even with a FutureBuilder for the UI, still freezing a few seconds until playing.

Code to Reproduce

InkWell(
    onTap: () async {
        await hp.playTrack();
    },
    child: Text('Click to play');
)
AudioPlayer player = AudioPlayer();
Future playTrack() async {
    final source = UrlSource(
        "https://vid.puffyan.us/latest_version?id=h2O6NDk3Qvc&itag=140&local=true&listen=1");
    await player.play(source);
}

Log Errors
No errors, just an unexpected freeze.

Files/URLs/Sources
UI Call: https://git.p2p.legal/poka/fipy/src/branch/kplayer2audioplayer/lib/screens/home.dart#L419
Controller action: https://git.p2p.legal/poka/fipy/src/branch/kplayer2audioplayer/lib/providers/home.dart#L103

Screenshots
Just image a UI freeze when choosing a song to play.

Platforms
Tried on Windows 10.

  • flutter version:
$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel beta, 2.13.0-0.3.pre, on Microsoft Windows [version 10.0.19044.1645], locale fr-FR)
[√] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
[√] Chrome - develop for the web
[√] Visual Studio - develop for Windows (Visual Studio Build Tools 2019 16.11.13)   
[√] Android Studio (version 2021.1)
[√] VS Code (version 1.67.0)
[√] Connected device (3 available)
[√] HTTP Host Availability
  • audioplayers version: 1.0.0-rc.2
  • release or not release: Debug and release mode.
  • does the error occur and does it have any peculiarities: No
@poka-IT poka-IT added the bug label May 6, 2022
@luanpotter
Copy link
Member

Please follow the issue template to include necessary information.

@luanpotter luanpotter added the changes-requested The issue or merge request doesn't fulfill the conventions and has to be changed by the author label May 8, 2022
@poka-IT
Copy link
Author

poka-IT commented May 8, 2022

Done
Let me know is you want me to try on Linux or Android device, but I don't think it's useful, because either you already know that or I'm just going wrong somewhere to use your lib.

@luanpotter luanpotter removed the changes-requested The issue or merge request doesn't fulfill the conventions and has to be changed by the author label May 8, 2022
@igorfastronicorrea
Copy link

did you manage to run the url of an mp3 with HTTP?

@poka-IT
Copy link
Author

poka-IT commented Jun 1, 2022

with https yes

@igorfastronicorrea
Copy link

I tried with http with security (https) and I don't success

@Gustl22 Gustl22 added the platform-windows Affects the windows platform label Sep 27, 2022
@Gustl22 Gustl22 changed the title [v1 rc2] play function on remote freeze UI windows [v1 rc2]: play function on remote freeze UI Sep 27, 2022
@xenSlayer
Copy link

any fix for this. My UI freezes completely when playing musics of longer duration with url as source playing youtube music.

Gustl22 added a commit that referenced this issue Apr 11, 2023
Gustl22 added a commit that referenced this issue Apr 17, 2023
Gustl22 added a commit that referenced this issue May 8, 2023
…g the source (#1469)

# Description

Add a callback when the player has prepared its source, which is tangled
to the asynchronous `setSource` method, to improve experience, when
player should actually play and not wait for the player to prepare /
load the source. 

## Related Issues

Closes #1118 
Closes #1384 
Closes #1359

#1191
flutter/flutter#126209
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug platform-windows Affects the windows platform
Projects
None yet
5 participants