SW55293 / state-machine

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Video State Machine

Here is the state machine with all of the states

alt tag

Explanation of states:

  1) LOADING: Is the initial state where we wait for the video to load
        - ready: If the load was successful we move to this set of states
        - failure: If for whatever reason the video failed to load we move to the fail state
  2) The set of ready states:
        - paused: The video playback is paused
        - playing: The video is playing
        - ended: Video has reached the end

The image below is the video player with custom controls

alt tag

XSTATE

      XSTATE:
      - Is a state management library It helps describe application state using finite state machines and statecharts.
        A state machine is a mathematical model of computation, it's an abstract state machine with a finite number of 
        states at any give time.
       
      - Using xstate allowed me to vizualize the states my react video player would have. 
      
      - Initially I just had VideoJS imported into my project and was not able to custom make my own controls with 
        videojs alone. I was only able to hide the deafault controls videojs came with and that wasn't my project 
        requirements so I had to continue my research into making my own video player controls in React. 
        
      - What my search led me to was XSTATE and using this 
        library helped create my own custom controls for a react video player.

About


Languages

Language:JavaScript 77.1%Language:HTML 13.7%Language:CSS 9.2%