Extensions

Audio

Audio extension

Play audio from a URL, asset, or base64 source.

Enable the extension

Add the extension key to ruflet.yaml:

extensions:
  - audio

Run ruflet run during development or ruflet build <target> for a release. Extension packages are compiled into the Ruflet client, so rebuild the client after changing this list.

Ruby DSL example

player = audio(
  src: "assets/notification.mp3",
  on_error: ->(event) { warn event.data }
)
page.add(player)
page.add(button("Play", on_click: ->(_event) { player.play }))

API provided

  • Extension key: audio
  • Flet package: flet_audio
  • Kind: Media control
  • Audio control reference — complete helpers, properties, events, and methods.

Permissions and platforms

No protected service declaration is added automatically. Platform support still follows the underlying Flet extension, so test every target you ship.

Build behavior

Ruflet resolves the extension key to flet_audio and includes that Flet package through the client extension pipeline. Application code uses the Ruby DSL shown above; do not add the package directly to your app's Flutter dependencies.