The library supports three types of media: video, audio and text. For each media there is a corresponding Web Component, which allow monetization with - or without - backend verification.
<wmm-video src="/media/video.mp4" paymentUrl="$ilp.uphold.com/4m2d2Xn4EUyk"></wmm-video>
By default, the media hosting backend will verify the payments and stream the media only when certain conditions are met. This is done by sending receipt verifications from the UI component to the /verifyReceipt path. The backend records account balances for each user and calculates the amount of payments made by the user, deducting the "amount" of media sent to the frontend.
The cost of media can be calculated in minutes or megabytes - or in words, in the case of text media. When the user account balance reaches zero, the user is notified about the error state with component. This includes instructions, like installing a wallet, or simply waiting for more payments to be made (in case of network latency issues).
Optionally there is a simpler component mode, that skips payment verification (and thus also accounting). In this mode, media can be downloaded from any URL even when the host doesn't support Web Monetization. The payments are still made if the user has a Web Monetization enabled wallet installed. E.g.:
<wmm-video skipVerification="true" src="http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" paymentUrl="..."></wmm-video>
The <wmm-audio> and <wmm-text> components use the same src and paymentUrl attributes. The only difference in the media component attributes, is that in the <wmm-text> the "simple mode" is implemented by passing the full text directly to the media attribute, instead of loading it from the backend.
See the documents for more detailed instructions. Time to press the play button!