livebook-dev / kino

Client-driven interactive widgets for Livebook
Apache License 2.0
361 stars 60 forks source link

Add `play` function to `Kino.Audio` #457

Closed relardev closed 1 month ago

relardev commented 2 months ago

I was looking for a way to notify myself when some event happens, tried implementing Kino.JS.Live that sends browser notification but didn't managed to make it work. Ended up using Kino.Audio with added functionality for playing the audio from the code:

      kino = Kino.Audio.new(...)
      // somewhere else, when some event happens
      Kino.Audio.play(kino)

I can open a PR if there is interest in adding this to Kino

jonatanklosko commented 1 month ago

Sounds good, a PR is welcome :) In that case it would make sense to pair it with Kino.Audio.pause/1.

jonatanklosko commented 1 month ago

Closed in #458.