diff --git a/src/Icons.elm b/src/Icons.elm index e87a38d..728669f 100644 --- a/src/Icons.elm +++ b/src/Icons.elm @@ -110,3 +110,19 @@ volumeX = , Svg.line [ x1 "23", y1 "9", x2 "17", y2 "15" ] [] , Svg.line [ x1 "17", y1 "9", x2 "23", y2 "15" ] [] ] + + +rewind : Bool -> Element msg +rewind = + svgFeatherIcon "rewind" + [ Svg.polygon [ points "11 19 2 12 11 5 11 19" ] [] + , Svg.polygon [ points "22 19 13 12 22 5 22 19" ] [] + ] + + +fastForward : Bool -> Element msg +fastForward = + svgFeatherIcon "fast-forward" + [ Svg.polygon [ points "13 19 22 12 13 5 13 19" ] [] + , Svg.polygon [ points "2 19 11 12 2 5 2 19" ] [] + ] diff --git a/src/Video.elm b/src/Video.elm index 0086dc2..66c21df 100644 --- a/src/Video.elm +++ b/src/Video.elm @@ -135,7 +135,16 @@ update msg model = ) Seek time -> - ( model, seek time ) + ( { model + | showIconRequested = + if time > model.position then + Just (Icons.fastForward True) + + else + Just (Icons.rewind True) + } + , seek time + ) SetPlaybackRate rate -> ( { model | showSettings = False, settings = All }, setPlaybackRate rate ) @@ -159,7 +168,19 @@ update msg model = ( { model | showSettings = False, settings = All }, setSubtitleTrack t ) SetVolume v m -> - ( model, setVolume { volume = v, muted = m } ) + ( { model + | showIconRequested = + if m then + Just (Icons.volumeX True) + + else if v >= model.volume then + Just (Icons.volume2 True) + + else + Just (Icons.volume1 True) + } + , setVolume { volume = v, muted = m } + ) AnimationFrameDelta delta -> let