Closed sunilguptasg closed 1 year ago
That's because this plugin provides functionally specifically for Android and iOS.
Hi, on pub.dev this has been marked "Android, IOS, MacOS, Web" - can you please get this fixed at it saves so much time!
The first paragraph of the README clearly explains that this plugin provides two wrapper classes for iOS (AVAudioSession) and Android (AudioManager). The fact that you see "Web" and "MacOS" listed on the pub.dev page doesn't mean anything needs to be fixed, this is intended. Although this plugin is completely useless in a Web app or a MacOS app, people still need to be able to cross compile their app to different platforms (even if for some of those platforms, some features are not available). So to summarise, this plugin is completely useless for Web and MacOS but can still be included in your common code base for other platforms even if it doesn't have any use on those other platforms. Nobody wants to have to edit their pubspec.yaml
just to cross compile for each individual platform.
Thanks for your detailed answer. And thanks for contributing code! Something I am still to do...
I beg to differ - the pub.dev page should list only platforms that the code works on - not just compiles on. Notes can be added that non-supported platforms support compile with no functionality.
Request you to reconsider your approach to listing supported platforms - I build first for one platform and then test for others in Flutter, and go by the tags to decide which package to use or to clearly understand that I will need others/build my own for others.
And one does not need to edit pubspec.yaml for cross compilation. There are ways to do it - I have different files for web, windows and devices - and never edit pubspec.yaml.
I will NOT be removing web support from this plugin, because just_audio depends on it.
The core methods of this plugin will route to the platform-specific capabilities "where available" and will otherwise default to no-ops where the platform either doesn't offer those capabilities or it is unimplemented. just_audio depends on this no-op behaviour of audio_session to handle phone call interruptions on platforms that have such a thing, and to do nothing on platforms that don't have such a thing.
Rather than arguing that I remove web no-ops that just_audio depends on, the productive thing to do would be to contribute code for any feature that you believe should not be a no-op on web.
Even the sample app, as it is, returns no devices. Tested on web.
Please help!