mirror of
https://github.com/heyarne/airsonic-ui.git
synced 2026-05-06 18:33:38 +02:00
Start restructuring audio playback, add some tests for audio
Fixes #15 where audio was not stopped on logout
This commit is contained in:
parent
727d454871
commit
80225d46b1
10 changed files with 187 additions and 69 deletions
|
|
@ -6,3 +6,14 @@
|
|||
[cofx ev]
|
||||
(let [all-events (conj (get cofx :dispatch-n []) (:dispatch cofx))]
|
||||
(boolean (some #(= ev (if (vector? ev) % (first %))) all-events))))
|
||||
|
||||
(defn rand-str
|
||||
"Generates a random string; ported from https://stackoverflow.com/a/27747377/2345852"
|
||||
([] (rand-str 40))
|
||||
([len]
|
||||
(let [arr (js/Uint8Array. (/ len 2))]
|
||||
(.. js/window -crypto (getRandomValues arr))
|
||||
(.. js/Array
|
||||
(from arr #(-> (str 0 (.toString % 16))
|
||||
(.substr -2)))
|
||||
(join "")))))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue