diff --git a/bin/main.ml b/bin/main.ml index f8f0273..d928bfc 100644 --- a/bin/main.ml +++ b/bin/main.ml @@ -22,13 +22,13 @@ let app _idb = El.txt' ("click" ^ string_of_int pl))); ]) in - let player = P.make () in let status = Elwd.div ~at:[ `P (At.style (Jstr.v "grid-column:1/-1")) ] [ `P (El.h1 [ El.txt' "Welcome to OCAMIX" ]); `R (Servers.ui ()) ] in let player_ui = + let player = P.make () in Elwd.div ~at:[ `P (At.style (Jstr.v "grid-column:1/-1")) ] [ `R player ] in let f_search = diff --git a/bin/player.ml b/bin/player.ml index 4ba6d38..1b5a64e 100644 --- a/bin/player.ml +++ b/bin/player.ml @@ -165,5 +165,10 @@ struct Brr_lwd_ui.Button.v ~ev:[ `P (Elwd.handler Ev.click next) ] (`P "NEXT") in let at = [ `P (At.class' (Jstr.v "player-wrapper")) ] in - Elwd.div ~at [ `P audio_elt; `R btn_next ] + let now_playing = + Lwd.map (Lwd.get now_playing) ~f:(function + | None -> El.txt' "Nothing playing" + | Some { item = { name; _ }; _ } -> El.txt' name) + in + Elwd.div ~at [ `R now_playing; `P audio_elt; `R btn_next ] end