Replies: 1 comment 2 replies
-
There's no example/guide on how to port capacitor plugins. You first follow https://v2.tauri.app/develop/plugins/ until you have a base project. Then the android files from https://github.com/jofr/capacitor-media-session/tree/main/android/src/main/java/io/github/jofr/capacitor/mediasessionplugin and the AndroidManifest.xml file can mostly be copy-pasted while adapting the package names. The ...Plugin.java file needs a few more modifications to change PluginCall to tauri's invoke/channel apis. You can check a few plugins in https://github.com/tauri-apps/plugins-workspace/ for reference. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I would like to implement an audio player in Tauri, that keeps playing without getting aborted by the Android device getting into standby or something. Furthermore I would like to implement specific click handlers that are not in the official MediaButton specification (e.g. tap-longpress for fastforward, tap-tap-longpress for rewind). Unfortunately longpress is not supported by the WebViews Mediasession or any key-handler that works while playing in background.
Therefore I would like to react on KeyUp and KeyDown events from Headset remot buttons to handle longpresses.
I found this capacitor plugin discussion which seems to solve exactly the problem I'm talking about, unfortunately I don't know how I could transfer this to Tauri / Rust:
#12616
I would love to see an example on how to do this with at least a few bits of code to have a starting point. Common LLMs just hallucinate about this topic.
Can anybody help me?
Beta Was this translation helpful? Give feedback.
All reactions