common.js

Methods

bindNotifications(wmm, inside)#

Binds monetization state notifications to a given component. The notification is shown when an error event is emitted from the component, and hidden when an OK event is emitted.
Parameters:
NameTypeDescription
wmmobjectWmmAudio, WmmVideo or WmmText instance.
insidebooleanadds notification inside the element as its last child
Source:

getErrorStateText() โ†’ {string}#

Maps Web Monetization state (in document.monetization) to a text that can be notified to the user.
Source:
Returns:
Monetization state text
Type
string

setUrl(wmm, url)#

A helper for setting WMM web component *src*. Adds userId to the URL and starts loading the content either by passing the URL to the inner media element (in case of audio and video) or by calling a specific load method (in case of text).
Parameters:
NameTypeDescription
wmmobjectWmmAudio, WmmVideo or WmmText instance.
urlstringURL or
Source: