A music player that connects to your cloud/distributed storage.
5
fork

Configure Feed

Select the types of activity you want to include in your feed.

Use specific play and pause event handlers

+32 -2
+8
src/Applications/UI.elm
··· 257 257 NoteProgress a -> 258 258 Audio.noteProgress a 259 259 260 + Pause -> 261 + Audio.pause 262 + 263 + Play -> 264 + Audio.play 265 + 260 266 Seek a -> 261 267 Audio.seek a 262 268 ··· 520 526 -- Audio 521 527 ----------------------------------------- 522 528 , Ports.noteProgress NoteProgress 529 + , Ports.requestPause (always Pause) 530 + , Ports.requestPlay (always Play) 523 531 , Ports.requestPlayPause (always TogglePlay) 524 532 , Ports.requestStop (always Stop) 525 533 , Ports.setAudioDuration SetAudioDuration
+14
src/Applications/UI/Audio/State.elm
··· 35 35 Return.singleton model 36 36 37 37 38 + pause : Manager 39 + pause model = 40 + return model (Ports.pause ()) 41 + 42 + 38 43 playPause : Manager 39 44 playPause model = 40 45 if Maybe.isNothing model.nowPlaying then ··· 45 50 46 51 else 47 52 communicate (Ports.play ()) model 53 + 54 + 55 + play : Manager 56 + play model = 57 + if Maybe.isNothing model.nowPlaying then 58 + Queue.shift model 59 + 60 + else 61 + return model (Ports.play ()) 48 62 49 63 50 64 seek : Float -> Manager
+6
src/Applications/UI/Ports.elm
··· 70 70 port requestNext : (() -> msg) -> Sub msg 71 71 72 72 73 + port requestPause : (() -> msg) -> Sub msg 74 + 75 + 76 + port requestPlay : (() -> msg) -> Sub msg 77 + 78 + 73 79 port requestPlayPause : (() -> msg) -> Sub msg 74 80 75 81
+2
src/Applications/UI/Types.elm
··· 195 195 -- Audio 196 196 ----------------------------------------- 197 197 | NoteProgress { trackId : String, progress : Float } 198 + | Pause 199 + | Play 198 200 | Seek Float 199 201 | SetAudioDuration Float 200 202 | SetAudioHasStalled Bool
+2 -2
src/Javascript/index.js
··· 539 539 if ("mediaSession" in navigator) { 540 540 541 541 navigator.mediaSession.setActionHandler("play", () => { 542 - app.ports.requestPlayPause.send(null) 542 + app.ports.requestPlay.send(null) 543 543 }) 544 544 545 545 546 546 navigator.mediaSession.setActionHandler("pause", () => { 547 - app.ports.requestPlayPause.send(null) 547 + app.ports.requestPause.send(null) 548 548 }) 549 549 550 550