-
Notifications
You must be signed in to change notification settings - Fork 133
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
Remove oto.NewPlayer #76
Comments
Possible you could have it keep a reference to the returned player, and return that each time? That way people can still have an easy way to do things, but it removes a gun pointed at their feet. |
Thanks. The problem of returning the singleton player is that we cannot expect what should happen when a different sample rate is given. |
You're for sure right, please ignore me. 😅 |
If you search GitHub, you find that quite a few people are still using it: https://github.com/search?q=%22oto.NewPlayer%22&type=Code . So I'm not sure if it's a good idea to remove it. But perhaps deprecate it, wait some time until people switch and then remove it? |
Ah good point... I think removing this is not feasible until everyone uses Go modules. |
CC @DianeLooney This API is problematic since calling oto.NewPlayer multiple times causes an error (NewContext cannot be called multiple times), even though Oto allows to call NewContext multiple times as long as the context is closed correctly. The context created by oto.NewPlayer internally can never be closed. It is hard to use oto.NewPlayer correctly. Then, I'll remove this function, maybe this weekend. |
It's already one year ago. Everyone should use Go modules :-) |
oto.NewPlayer
(not(*otoContext).NewPlayer
exists for backward compatibility, but this is confusing (e.g.oto.NewPlayer
cannot be called multiple times). I started to think this should be removed.Any thoughts? @faiface @Noofbiz
The text was updated successfully, but these errors were encountered: