-
Notifications
You must be signed in to change notification settings - Fork 25
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
Audio Player #3
Comments
I'm trying to get libwinmedia to work, it compiles and works fine on flutter desktop for windows but it doesn't build the so for the elinux builds. Any idea why that's happening |
We need to create |
@HidenoriMatsubayashi Yup thats exactly how I started and what I did but the problem is a little different. This project depends on I was thinking maybe just |
Only about flutter support in About miniaudio. If we use this library in flutter (flutter-elinux), we also need to a plugin interface implementation like video player. About Canonicals Dbus. I guess we can use it as it is with flutter-elinux because it's just Dart source project (not platform specific code files). |
@HidenoriMatsubayashi The reason why I asked about Canonicals Dbus was that they're doing ffi calls in their dart code at certain points, like here
Would doing these ffi calls provide performance related problems? If you could link to some documentation that helped guide you in writing the video player plugin that would really help. I've written a few Native Node Addons for nodejs to replace FFI calls to an .so file so I do have some idea of what I'm doing however I'm confused about the approach in dart. Canonical has added FFI calls here and there in their code base but other libraries have separate folders for each platform and a lot of C++ code. Why I pitched the idea of miniaudio is that it'll provide a single header file (though it is 2.8 mb) with no external dependencies while providing compatibility on almost all desktop platforms. |
I followed the official tutorial for making native bindings but with flutter elinux and platform as elinux
|
Any advice on why this is coming up on a clean generated template?
I saw that you're using a standard template for the video player plugin, except for adding the requirements for
|
No, I don't think so. ffi is a common way to bind a target programming language to other one. Generally, in terms of flutter app performance, the plugins used ffi are better than plugins use Flutter plugin interfaces (APIs).
I'm not sure. Is it possible to see your project somewhre?
Exactly. |
@HidenoriMatsubayashi yup the clean generated template is here. I haven't added anything custom yet, so I shouldn't be getting any errors? |
Actually I just checked, the generated template wasn't putting in the appriopriate platform inside of the
instead of
After changing that the template has been built successfully with the plugin! |
That's good. I'm` happy to hear that! |
@HidenoriMatsubayashi Can you link a guide or reference you used to build the video plugin, I'm having a little trouble figuring out what goes into which file. I'm basically just changing the miniaudio python bindings word for word into dart. Also how do you import the c types like enum values and all when using method channels? |
Unfortunetlly, I have no good guides or references, but you need to decide the APIs between Dart (flutter) and platform (miniaudio) using MethodChannel and/or EventChannel. It's just simply async message passing.
Probably, you need to use map. e.g. camera plugin: |
I see, I've gone through them and from what I can understand is that the generated example is using method calls but these implementations are doing some things differently. Like here
The dart side of the implementation is invoking a specific method on the CPP side and then it gets matched and responded too on the CPP side. However in the code for the video player things are being done very differently.
Every thing is configured according to different method channels and instead of invocation, encoded data is sent directly to that handler. There is no matching done since no method was invoked and the logic is implementation on the sent data.
Can you explain why is the generated template so different from the video player plugin? Were you constrained by however the platform api was coded for the flutter plugin for compatibility reasons? Also which method should I go with, because neither really has any documentation what so ever however this method at least has a couple of examples in this repository. |
Because the generated template is just simply example/templete. Also, it's completely the same with the official Flutter desktop for Linux's one.
What does it mean? The plugin interface/APIs are completely the same as the official flutter desktop for Windows. It means developers can implement their plugins with the same ways of flutter windows. Flutter plugins for Windows platform will help you. You can use the following cpp plugin APIs. |
@HidenoriMatsubayashi okay so I've completed some very rough bindings for now and called it Ping because it's meant to only play simple sounds for notifications etc., not really meant to be a whole audio player. My only question is that the code should be the same for Windows or even Linux due to minaudio but since it's restricted to the elinux directory what am I supposed to do? Right now the only way for me to test it is to run it on an embedded flutter device. The example it broken I'll update it after I've done some testing and fixed up any bugs. |
Do you know any I'm having this issue, I've added a fPIC flag into the plugins CMake, the plugin compiles fine on x86 but cross compiling gives this error.
|
Hello. I tried porting audioplayers for elinux. |
Great! If you send the pull request, I'll review it and then submit it. |
Closing. Thanks a lot. |
Create AudioPlayer plugin
The text was updated successfully, but these errors were encountered: