A minimal web player written in Elm, just for fun. The goals was a minimal web-app that can be hosted on my Minio (s3) next to the video content.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

27 lines
691 B

port module Update exposing (..)
import Msg
import Model exposing (Model)
update : Msg.Msg -> Model -> ( Model, Cmd Msg.Msg )
update msg model =
case msg of
Msg.VideoSelected "" ->
( { model | selected = Nothing }, reloadVideoSource () )
Msg.VideoSelected path ->
( { model | selected = Just path }, reloadVideoSource () )
Msg.VideoListLanded response ->
case response of
Ok videos ->
( { model | videos = videos }, Cmd.none )
Err _ ->
( model, Cmd.none )
Msg.NoOp ->
( model, Cmd.none )
port reloadVideoSource : () -> Cmd msg