mirror of
https://github.com/heyarne/airsonic-ui.git
synced 2026-05-07 02:33:39 +02:00
Can play a single song :)
This commit is contained in:
parent
9ca116ee72
commit
0e17354e58
4 changed files with 28 additions and 1 deletions
13
src/airsonic_ui/audio.cljs
Normal file
13
src/airsonic_ui/audio.cljs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
(ns airsonic-ui.audio
|
||||
(:require [re-frame.core :as re-frame]))
|
||||
|
||||
;; TODO: Manage multiple songs, buffering, stopping, progress notification...
|
||||
|
||||
(def current-audio (atom nil))
|
||||
|
||||
(re-frame/reg-fx
|
||||
:play-song
|
||||
(fn [song-url]
|
||||
(let [audio (js/Audio. song-url)]
|
||||
(reset! current-audio audio)
|
||||
(.play audio))))
|
||||
Loading…
Add table
Add a link
Reference in a new issue