Gadulka 1.4 brings experimental WASM support
Posted by:
-
Konstantin
Kotlin Multiplatform has been gaining traction lately. Just in the last few weeks, I've had two separate occasions to chat about the technology with folks outside my usual tech bubble.
And it's not surprising, of course. Kotlin Multiplatform offers a unique blend of native and cross-platform technologies to enable maximum flexibility for how an app should be built. Some may choose to go all in Compose Multiplatform, while in other cases, it can be helpful to rely on the native platform's UI layer (e.g. SwiftUI) while sharing the rest of the app's implementation with Desktop, Android, web, etc.
As I already posted a while ago, one of my side projects required the capability to play audio files from a remote URL. That's why I created Gadulka — a minimalistic Kotlin Multiplatform Audio player.
This version, adds a convenience overload to the `play()` method, allowing passing in a resource identifier to bundled resources. Under the hood, Gadulka will use a `ContentResolver` to fetch the raw resource file. For more information on managing resources in Kotlin Multiplatform project, it's worth having a look at the docs from JetBrains.
This version brings experimental support for WASM targets. I've been learning more about ways of making convenient APIs for WASM, and creating an audio player for such a versatile platform is certainly a challenge. In Gadulka 1.4.0, I opted to try simply appending an `<audio>` tag to the DOM. I think it's a good starting point to allow further exploration on how to best approach the feature.
Get started now, and don't hesitate to sign up for my newsletter for future release announcements. Thank you!