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.

Constructor

new WmmAudio()#

Source:

Members

src#

Synchronise wmm-audio elements *src* attribute with inner audio -elements *src* attrubute.
Source:

Methods

addEventListener(name, action)#

Event 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:
NameTypeDescription
namestringEvent name
actionfunctionThe action to execute on event.
Source:

connectedCallback()#

Initializes monetization and styles when component is inserted into DOM.
Source:

disconnectedCallback()#

Stops monetization and disconnects the media stream when component is removed from DOM.
Source:

removeEventListener(name, action)#

Remove monetization or video element listener
Parameters:
NameTypeDescription
namestringEvent name
actionfunctionThe action to execute on event.
Source: