Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Return muted as a boolean instead of a function #156

Closed
wants to merge 1 commit into from

Conversation

nwestbury
Copy link

Currently this returns the howl.mute which returns the entire Howler object, but the type says this should be a boolean.

Looking at howler.js, it looks like the mute boolean is never publicly exposed from Howler, unfortunately. From testing, just checking the volume at 0 doesn't work.

It's not great to expose private properties like this, but I expect Howler to be stable enough and this is better than existing functionality.

Currently this returns the `howl.mute` which returns the entire Howler object, but the type says this should be a boolean.

Looking at [howler.js](https://github.com/goldfire/howler.js/blob/a2a47933f1ffcee659e4939a65e075fa7f25706c/src/howler.core.js#L1153), it looks like the mute boolean is never publicly exposed. From testing, just checking the volume at 0 doesn't work.

It's not great to expose private properties like this, but I expect Howler to be stable enough and this is better than existing functionality.
@nwestbury
Copy link
Author

nwestbury commented Feb 18, 2025

I see this was already being discussed in #141. I'm fine with the suggestion to remove it as well but it's at least useful in some cases. LMK what you think here.

@nwestbury
Copy link
Author

Actually from further testing, this doesn't work -- it returns undefined when muted is true. Probably just removing the property is sensible.

@nwestbury nwestbury closed this Feb 18, 2025
@E-Kuerschner
Copy link
Owner

@nwestbury should hopefully have a release in the next week or two for v4 which address this issues amongst others. Notably it involves a rewrite against a newer version of React in order to make use of useSyncExternalStore for future maintainability

@nwestbury
Copy link
Author

@E-Kuerschner Awesome. Appreciate your work!

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

Successfully merging this pull request may close these issues.

2 participants