Fork me on GitHub
#fulcro
<
2018-04-27
>
ianchow10:04:36

anyone worked with html5 audio in fulcro? trying to figure out how a property in app-state can affect the playback of an audio object (play, pause etc), and where to actually place the Audio object since app-state and component local state sounds like a bad idea. pointers appreciated.

tony.kay15:04:54

@ianchow So, I would consider the fact that the audio player has it’s own state, and you should treat that as the “store” of that state, not duplicate it.

tony.kay15:04:00

Interfacing with the stateful world means you’ve just got some external state to deal with. If you need the UI to respond to that state, then hook event handlers to the change events that come from the components and transact against the reconciler to update your UI state to match.

wilkerlucio17:04:25

@ianchow yes, in Dave Conservatoire there are plenty usages of Audio API, you can look up in the project usages for this namespace: https://github.com/daveconservatoire/dcsite-cljs/blob/master/src/cljs/daveconservatoire/audio/core.cljs