1
0
Fork 0
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:
Arne Schlüter 2018-04-20 16:21:19 +02:00
commit 0e17354e58
4 changed files with 28 additions and 1 deletions

View 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))))