Namespace: util

Utilities module. Contains several helpful functions that don't fit anywhere else.

Methods

Appends css to the document head
Parameters:
Name Type Description
uri String Absolute or relative path to the css file
Returns:
jQuery object
Type:
Object
Ensure that a function, likely a object method, is called with the proper context
Parameters:
Name Type Description
func function Function to call
context Object Context that the function will execute in
Returns:
The closure of the function call with the given context
Type:
function
Removes undefined or null values from an array
Parameters:
Name Type Description
src Array The source array
deep boolean If truthy will recursively drop elements with undefined values
Returns:
A processed copy of src, or the same object if src is not an array
Type:
Object
Triggers callbacks that have been pased into an app's configuration object, or have been attached to the app beacon or target div
Parameters:
Name Type Description
name String Event name
app Object Application object: a Player or Playlist, for example.
passthroughArgs Array Additional arguments to pass to the event handler. The config object is automatically added as the first argument
Transforms a large number into something more readable
Parameters:
Name Type Description
t Number The time in seconds
Returns:
The formatted time in the form: 'hh:mm:ss'
Type:
String
Used internally to resolve renderers and some callback functions
Parameters:
Name Type Description
defaultCall function | null A function to fall back on
overrideCall function | String May be a string (globally namespaced reference) or a literal function
Returns:
A literal function. If overrideCall is not a function/string, defaultCall will be returned
Type:
function
Used internally to pick correctly sized thumbnail image
Parameters:
Name Type Description
thumbs Array Array of thumbnails from playlist item
targetSize Number Intended width of the image
Returns:
URI of the image
Type:
string
Convert any boolean overrides that are in string form, into boolean literals
Parameters:
Name Type Description
list Object An array or hash
deep boolean If truthy, will convert values recursively for nested objects
Returns:
A modified copy of the list
Type:
Object
Converts an XML object to a string
Parameters:
Name Type Description
elem Object XML document object representation
Returns:
Stringified xml
Type:
String