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:
| Name | Type | Description |
|---|---|---|
wmm | object | WmmAudio, WmmVideo or WmmText instance. |
inside | boolean | adds notification inside the element as its last child |
getErrorStateText() โ {string}#
Maps Web Monetization state (in document.monetization) to a text that can be notified to the user.
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:
| Name | Type | Description |
|---|---|---|
wmm | object | WmmAudio, WmmVideo or WmmText instance. |
url | string | URL or |