WmmAudio.js
Class: WmmAudio
WmmAudio()
Creates a web monetized audio element <wmm-audio>
Attributes:
* src: audio file source; if full URL is used, the recipe verification will use the same host for verification.
* paymentUrl: Payment pointer URL, can also include receipt service url.
* skipVerification: if true, don't send receipts to backend for verifications.
Attributes:
* src: audio file source; if full URL is used, the recipe verification will use the same host for verification.
* paymentUrl: Payment pointer URL, can also include receipt service url.
* skipVerification: if true, don't send receipts to backend for verifications.
Members
#
srcSynchronise wmm-audio elements *src* attribute with inner audio -elements *src* attrubute.
- Source:
Methods
(name, action)#
addEventListenerEvent listener for monetization and video events. Binding to monetization events ('monetizationStopped', 'monetized', 'monetizeFailed') allows tracking of monetization state, while all other events are passed to the inner <audio> element and can be used to track the state of the media. E.g. https://developer.mozilla.org/en-US/docs/Web/Guide/Events/Media_events
Parameters:
Name | Type | Description |
---|---|---|
name | string | Event name |
action | function | The action to execute on event. |
- Source:
()#
connectedCallbackInitializes monetization and styles when component is inserted into DOM.
- Source:
()#
disconnectedCallbackStops monetization and disconnects the media stream when component is removed from DOM.
- Source:
(name, action)#
removeEventListenerRemove monetization or video element listener
Parameters:
Name | Type | Description |
---|---|---|
name | string | Event name |
action | function | The action to execute on event. |
- Source: