November 2019
Beginner
436 pages
8h 52m
English
To turn an HTML element into a Play button, you need to use the amplitude-play CSS class like so:
<span class="amplitude-play"></span>
As you can see, adding the amplitude-play class turns an element into a clickable object that starts music playback. Let's use this class with a button element in our application:
<!DOCTYPE html><html> <head> <meta charset="UTF-8" /> <title>Music Player</title> </head> <body> <h1>Music Player</h1> <div> <button class="amplitude-play">Play</button> </div> <script src="./node_modules/amplitudejs/dist/amplitude.js"></script> <script src="./player.js"></script> </body></html>
Read now
Unlock full access