Skip to content

Conversation

@haimomesi
Copy link

Actually play the file

Actually play the file
@haimomesi
Copy link
Author

Sorry about the poor documentation. first time ever submitting a pull request :)

This will prevent from other processes to drop sound
@bazuka5801
Copy link
Contributor

@haimomesi Hi :)
What your PR fix, or what feature you want to add?

@haimomesi
Copy link
Author

@haimomesi Hi :)
What your PR fix, or what feature you want to add?

When we call loop function, the file does not play, as the documentation say.

The dispatcher class only set the setLooping state to true, but never call the play function.

Unless it’s intended to be use as
loop({ assetId })
play({ assetId })

The second commit was to solve a problem in iOS which our WKWebView’s getUserMedia would break the stream after an asset played with this plugin. That’s why when we play a file, we set the category as playback, and when we finish we set it as ambient

@tgangso
Copy link

tgangso commented Aug 26, 2021

Would be great to get this merged in. Fixes some important issues.


public void loop() throws Exception {
mediaPlayer.setLooping(true);
invokePlay(0.0, true);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need to play from scratch when we want to loop the current music

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you reply on the last comment?
It addresses your question as well

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@haimomesi I have work tasks where I need to use loop without play. These are different methods, you should separate them and let the app call them when necessary

dpa99c pushed a commit to dpa99c/capacitor-native-audio that referenced this pull request Apr 1, 2025
add error handling information from Swift call to AVAudio
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

Successfully merging this pull request may close these issues.

3 participants