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

Export the native platform instance for more access (especially with plugins) #1222

Open
Pato05 opened this issue Apr 7, 2024 · 2 comments
Assignees
Labels
1 backlog enhancement New feature or request

Comments

@Pato05
Copy link

Pato05 commented Apr 7, 2024

Is your feature request related to a problem? Please describe.
It would allow for access on more options on my library just_audio_media_kit, and I'm guessing on other plugins as well.

Describe the solution you'd like
Have a getter like AudioPlayer.platform or AudioPlayer.nativePlayer (with AudioPlayer being the player instance) to get the underlying AudioPlayerPlatform instance

Describe alternatives you've considered
None

Additional context
None

@Pato05 Pato05 added 1 backlog enhancement New feature or request labels Apr 7, 2024
@ryanheise
Copy link
Owner

This is something I was also considering for just_audio_background which installs a custom platform interface implementation, since some users want an easy way to have one player using that implementation, and another player using a different implementation. This would involve not a getter but a setter.

So maybe the solution is to add a platform field, but mark it with some sort of annotation that gives appropriate warnings.

If you wouldn't mind, could you also provide some specifics about you would do with this API?

@Pato05
Copy link
Author

Pato05 commented Apr 8, 2024

If you wouldn't mind, could you also provide some specifics about you would do with this API?

In my specific case, since I'm wrapping another library's player object, this would allow for finer tuning like setting specific libmpv properties via the setProperty api, for example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1 backlog enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants