akamai.amp.AutoplayThreshold

The AutoplayThreshold utility class.

Members

ALLOWED

(static, readonly) :string

Threshold indicating autoplay is allowed.

BLOCKED

(static, readonly) :string

Threshold indicating autoplay is blocked.

MUTED

(static, readonly) :string

Threshold indicating muted autoplay is allowed.

MUTED_INLINE

(static, readonly) :string

Threshold indicating muted inline autoplay is allowed.

UNKNOWN

(static, readonly) :string

The autoplay threshold is unknown. Detection has not been attempted.

Methods

detect

(static) detect(urlopt, supportedopt) → {Promise.<akamai.amp.AutoplayThreshold>}

Attempts to detect the platform's autoplay threshold.

Parameters
Name Type Attributes Description
url string <optional>

The url used by the video tag for autoplay detection.

supported function <optional>

A

Returns
Promise.<akamai.amp.AutoplayThreshold>

The evaluated result

init

(static) init(policyopt) → {Promise.<akamai.amp.AutoplayThreshold>}

Initializes the AutoplayThreshold utilities.

Parameters
Name Type Attributes Description
policy akamai.amp.AutoplayPolicy <optional>

The autoplay mode to initialize against.

Returns
Promise.<akamai.amp.AutoplayThreshold>

The evaluated result

supported

(static) supported() → {boolean}

Returns the default platform filter function. The function is called at the begining of the autoplay detection process to determine if the platform supports autoplay.

Returns
boolean

url

(static) url() → {string}

Returns the default url used by the video tag for autoplay detection. Defaults to a base64 encoded data uri of sample mp4 content.

Returns
string

The data uri

value

(static) value(refreshopt) → {Promise.<akamai.amp.AutoplayThreshold>}

The autoplay threshold.

Parameters
Name Type Attributes Default Description
refresh boolean <optional>
false
Returns
Promise.<akamai.amp.AutoplayThreshold>

The evaluated result