anhmiuhv / pannablevideo / PannableVideo

This library provide a pannable and zoomable video element.

Look in examples to see how to use this library

View

pannableVideo : (Msg -> msg) -> State -> VideoInfo -> Html msg

The zoomable, pannable video element. Look for State and VideoInfo below

advancedPannableVideo : (Msg -> msg) -> State -> VideoInfo -> List (Html.Attribute msg) -> List (Html msg) -> Html msg

More advanced video element if you want to style, or do something I can't think of

Model


type State

Internal state of the element. Should be part of model


type alias VideoInfo =
{ videoSrc : String
, videoSize : ( Basics.Int
, Basics.Int )
, minScale : Basics.Float
, maxScale : Basics.Float 
}

Represent the info of the video. This currently includes:

initialState : State

The initial state to be put into init

simpleVideoInfo : String -> ( Basics.Int, Basics.Int ) -> VideoInfo

Simple VideoInfo object.

Take in: source of the video -> size in px

Events


type Msg

Internal Event Manager. Should be sent to processEvent in the update

processEvent : Msg -> State -> State

Process Msg in the update function