Skip to content

Latest commit

 

History

History
377 lines (269 loc) · 10.8 KB

api.md

File metadata and controls

377 lines (269 loc) · 10.8 KB

Modules

container

Hosts the Container class.

controls

Hosts all player-controls-related code and the Controls class.

dispatcher

Hosts all event-related code and the Dispatcher class.

errors

Hosts all error-related code and the PlayerError class.

helpers

Hosts all helper functions.

interval

Hosts the MasterInterval class.

player

Hosts the Player class.

video

Hosts the Video class.

Classes

Dart

Constants

defaultStyles : string

The default styles for the video player.

events : array

The official list of valid video player events.

playIcon : string

The SVG markup for the "play" button. Taken from the "Feather" collection at https://feathericons.com/.

pauseIcon : string

The SVG markup for the "pause" button. Taken from the "Feather" collection at https://feathericons.com/.

previousIcon : string

The SVG markup for the "previous" button. Taken from the "Feather" collection at https://feathericons.com/.

nextIcon : string

The SVG markup for the "next" button. Taken from the "Feather" collection at https://feathericons.com/.

loadingIcon : string

The SVG markup for the loading icon. Taken from Sam Herbet's collection here: http://samherbert.net/svg-loaders/

layout : string

The CSS layout defaults for the video player.

readyStates : object

Aliases for the video element ready states.

selectors : object

CSS selectors for the video player.

container

Hosts the Container class.

container~Container

Kind: inner class of container

new Container(props, dispatcher)

The video player's outer HTML.

Param Type Description
props object Configuration for the container.
dispatcher object The Dispatcher instance of the video player.

container~defaultDimensions : object

The default player dimensions if neither "resizeToFitParent" nor "dimensions" are passed on instantiation.

Kind: inner constant of container

controls

Hosts all player-controls-related code and the Controls class.

controls~Controls

Kind: inner class of controls

new Controls(player, parentNode)

Facilitates user interaction with the video player.

Param Type Description
player object The video player instance.
parentNode object The element to append the controls to.

controls~isValidEvent(event)

  • Determines if the submitted event is officially recognized by the player.

Kind: inner method of controls

Param Type Description
event string The event being assessed.

dispatcher

Hosts all event-related code and the Dispatcher class.

dispatcher~Dispatcher

Kind: inner class of dispatcher

new Dispatcher(debug)

Coordinates internal video player events. The Dispatcher instance for the video player gets initialized as a property of the Player instance, then passed to sub-components of the player on their instantiation. This way, events emitted on sub-components can bubble up to the player's interface.

Param Type Description
debug boolean Whether the player is initialized in developer mode.

errors

Hosts all error-related code and the PlayerError class.

errors~PlayerError

Kind: inner class of errors

new PlayerError(props, dispatcher)

Describes and reports internal player errors.

Param Type Description
props object Error data.
dispatcher object The Dispatcher instance of the video player.

helpers

Hosts all helper functions.

helpers~DOMHelpers : object

DOM-related helper functions.

Kind: inner namespace of helpers

helpers~mathHelpers : object

Math-related helper functions.

Kind: inner namespace of helpers

interval

Hosts the MasterInterval class.

interval~MasterInterval

Kind: inner class of interval

new MasterInterval()

Handles all interval-based checks.

player

Hosts the Player class.

player~Player

Kind: inner class of player

new Player(props)

The interface for a video player instance.

Param Type Description
props object Configuration options for the player.

video

Hosts the Video class.

video~Video

Kind: inner class of video

new Video(props, dispatcher)

Video instances within the player.

Param Type Description
props object Configuration for the video.
dispatcher object The Dispatcher instance of the video player.

Dart

Kind: global class

new Dart()

Gets instantiated and written to the window as the value of "globalVarName" in package.json.

Dart.create()

Generates a new instance of the Player class and exposes a limited interface.

Kind: static method of Dart

defaultStyles : string

The default styles for the video player.

Kind: global constant

events : array

The official list of valid video player events.

Kind: global constant

playIcon : string

The SVG markup for the "play" button. Taken from the "Feather" collection at https://feathericons.com/.

Kind: global constant

pauseIcon : string

The SVG markup for the "pause" button. Taken from the "Feather" collection at https://feathericons.com/.

Kind: global constant

previousIcon : string

The SVG markup for the "previous" button. Taken from the "Feather" collection at https://feathericons.com/.

Kind: global constant

nextIcon : string

The SVG markup for the "next" button. Taken from the "Feather" collection at https://feathericons.com/.

Kind: global constant

loadingIcon : string

The SVG markup for the loading icon. Taken from Sam Herbet's collection here: http://samherbert.net/svg-loaders/

Kind: global constant

layout : string

The CSS layout defaults for the video player.

Kind: global constant

readyStates : object

Aliases for the video element ready states.

Kind: global constant

selectors : object

CSS selectors for the video player.

Kind: global constant