MediaContainer

MediaContainer

new MediaContainer(element, options)

Source:
Parameters:
Name Type Description
element HTMLElement

DOM element for component instantiation and scope

options Object
Properties
Name Type Description
iframeSelector String

Selector for iframe element

useAutomaticRatio boolean

Toggle automatic ratio calculus

videoTitleSelector String

Selector for video title

videoPlay String

Selector for the video play button

videoPause String

Selector for the video pause button

captionSelector String

Selector for the caption element

creditSelector String

Selector for the credit element

attachResizeListener boolean

Whether to attach a listener on resize

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:
Name Type Description
Event e
Fires:
  • MediaContainer#event:onPauseClick

handlePlayClick(Event)

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

Source:
Parameters:
Name Type Description
Event e
Fires:
  • MediaContainer#event:onPlayClick

handleResize()

Description:
  • Trigger setCaptionBottom on resize. Uses a debounce, for performance.

Source:

init()

Description:
  • Initialise component.

Source:

setCaptionBottom()

Description:
  • Sets the --ecl-caption-bottom CSS variable on the figure so the caption clears the credit when both are displayed in caption-over mode.

Source:

(static) autoInit(root) → {MediaContainer}

Source:
Parameters:
Name Type Description
root HTMLElement

DOM element for component instantiation and scope

Returns:

An instance of MediaContainer.

Type
MediaContainer