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

Update AudioDispatcher.java #34

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

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.

@@ -92,6 +92,7 @@ public void setVolume(float volume) throws Exception {

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

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