MediaContainer

MediaContainer

new MediaContainer(element, options)

Source:
Parameters:
NameTypeDescription
elementHTMLElement

DOM element for component instantiation and scope

optionsObject
Properties
NameTypeDescription
iframeSelectorString

Selector for iframe element

useAutomaticRatioboolean

Toggle automatic ratio calculus

videoTitleSelectorString

Selector for video title

videoPlayString

Selector for the video play button

videoPauseString

Selector for the video pause button

Classes

MediaContainer

Methods

calculateRatio()

Description:
  • Calculate the ratio of the iframe video.

Source:

destroy()

Description:
  • Destroy component.

Source:

handleParameters()

Description:
  • Handle the parameters of the iframe video.

Source:

handlePauseClick(Event)

Description:
  • Triggers a custom event when clicking on the pause button.

Source:
Parameters:
NameTypeDescription
Evente
Fires:
  • MediaContainer#event:onPauseClick

handlePlayClick(Event)

Description:
  • Triggers a custom event when clicking on the play button.

Source:
Parameters:
NameTypeDescription
Evente
Fires:
  • MediaContainer#event:onPlayClick

init()

Description:
  • Initialise component.

Source:

(static) autoInit(root) → {MediaContainer}

Source:
Parameters:
NameTypeDescription
rootHTMLElement

DOM element for component instantiation and scope

Returns:

An instance of MediaContainer.

Type
MediaContainer