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

Audio playback stops during scroll #5

Open
alexiscreuzot opened this issue May 6, 2022 · 2 comments
Open

Audio playback stops during scroll #5

alexiscreuzot opened this issue May 6, 2022 · 2 comments

Comments

@alexiscreuzot
Copy link

Is there an option to specify the RunLoop ?

@FlorianAtNacamar
Copy link
Collaborator

FlorianAtNacamar commented May 9, 2022

All API-Methods (see AudioPlayer.swift and YbridControl.swift) wrap the execution of player internals asynchronously using let playerQueue = DispatchQueue(label: "io.ybrid.playing"). All callback methods of AudioPlayerListener are asynchronously called by DispatchQueue.global().async { ... .

We use Swift's Grand Central Dispatch API to strictly decouple the player itself from the usage of the player. One purpose of GCD is to hide the thread layer from the developer. As far as I know there is no way to change the specific RunLoop (working thread).

Can you tell, why this is neccessary to you?

Would you please describe the audio you use and the action/s you mean by 'scrolling'.

@alexiscreuzot
Copy link
Author

When playing an audio file (local data) with the SDK, it appears to stop when I scroll through a UITableView. So I'm guessing the async task is still running on a RunLoop that gets halted by the system during user interaction. I'll do some more testing to confirm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants