Popup()

new Popup()

Extends

Methods

$(selector, contextopt) → {Element|null}

Find a single DOM element matching a selector. This can be within the Components
contentEl() or another custom context.

Parameters:

Name

Type

Attributes

Default

Description

selector

string

A valid CSS selector, which will be passed to querySelector.

context

Element
|
string

<optional>

this.contentEl()

A DOM element within which to query. Can also be a selector string in
which case the first matching element will get used as context. If
missing this.contentEl() gets used. If this.contentEl() returns
nothing it falls back to document.

Returns:

$$(selector, contextopt) → {NodeList}

Finds all DOM element matching a selector. This can be within the Components
contentEl() or another custom context.

Parameters:

Name

Type

Attributes

Default

Description

selector

string

A valid CSS selector, which will be passed to querySelectorAll.

context

Element
|
string

<optional>

this.contentEl()

A DOM element within which to query. Can also be a selector string in
which case the first matching element will get used as context. If
missing this.contentEl() gets used. If this.contentEl() returns
nothing it falls back to document.

el() → {Element}

Returns:

enableTouchActivity()

This function reports user activity whenever touch events happen. This can get
turned off by any sub-components that wants touch events to act another way.

Report user touch activity when touch events occur. User activity gets used to
determine when controls should show/hide. It is simple when it comes to mouse
events, because any mouse event should show the controls. So we capture mouse
events that bubble up to the player and report activity when that happens.
With touch events it isn't as easy as touchstart and touchend toggle player
controls. So touch events can't help us at the player level either.

User activity gets checked asynchronously. So what could happen is a tap event
on the video turns the controls off. Then the touchend event bubbles up to
the player. Which, if it reported user activity, would turn the controls right
back on. We also don't want to completely block touch events from bubbling up.
Furthermore a touchmove event and anything other than a tap, should not turn
controls back on.

localize(string, tokensopt, defaultValueopt) → {string}

If tokens are provided, it'll try and run a simple token replacement on the provided string.
The tokens it loooks for look like {1} with the index being 1-indexed into the tokens array.

If a defaultValue is provided, it'll use that over string,
if a value isn't found in provided language files.
This is useful if you want to have a descriptive key for token replacement
but have a succinct localized string and not require en.json to be included.