Global

Methods

get()

Calls a getter on the tech first, through each middleware from right to left to the player.

isPromise(value) → {Boolean}

Returns whether an object is Promise-like (i.e. has a then method).

Parameters:
Name Type Description
value Object

An object that may or may not be Promise-like.

Returns:
Boolean -

Whether or not the object is Promise-like.

mediate()

Takes the argument given to the player and calls the call version of the method on each middleware from left to right. Then, call the passed in method on the tech and return the result unchanged back to the player, through middleware, this time from right to left.

module:merge-options(sources) → {Object}

Deep-merge one or more options objects, recursively merging only plain object properties.

Parameters:
Name Type Description
sources Array.<Object>

One or more objects to merge into a new object.

Returns:
Object -

A new object that is the merged result of all sources.

set()

Takes the argument given to the player and calls the setter method on each middlware from left to right to the tech.

silencePromise(value)

Silence a Promise-like object.

This is useful for avoiding non-harmful, but potentially confusing "uncaught play promise" rejection error messages.

Parameters:
Name Type Description
value Object

An object that may or may not be Promise-like.