Quick Start Guide
Here is the most minimal example of adding Webamp to an HTML page:
<!DOCTYPE html>
<html>
<body>
<div id="app" style="height: 100vh">
<!-- Webamp will attempt to center itself within this div -->
</div>
<script type="module">
import Webamp from "https://unpkg.com/webamp@^2";
const webamp = new Webamp({});
// Returns a promise indicating when it's done loading.
webamp.renderWhenReady(document.getElementById("app"));
</script>
</body>
</html>
tip
For more examples you can copy from, see Examples.
Next Steps
- Installation - Learn how to install Webamp in your project, including how to use it with npm or a CDN.
- Initialization - Learn about initializing Webamp, including how to create a Webamp instance and render it in your HTML document.
- API - Learn about the Webamp API, including how to control playback, add tracks, and more.
- Webamp Constructor Options - Learn about the options you can pass to the Webamp constructor.
- Webamp Instance Methods - Learn about the methods you can call on a Webamp instance.