@warmerdam-ai/webplayer
v0.2.0
Published
Embeddable media player widget — add a script tag and every media link becomes playable
Maintainers
Readme
WebPlayer
Embeddable media player widget -- add a script tag and every media link becomes playable.
Quick Start
Drop a single script tag into any HTML page:
<script>
var WPParams = { source: 'youtube' };
</script>
<script src="https://webplayer.warmerdam.ai/widget/loader.js" async></script>WebPlayer will scan the page for media links and make them playable automatically.
Install via npm
npm install @warmerdam-ai/webplayerimport { PublicAPI, registerAll } from '@warmerdam-ai/webplayer';
// Register all Web Component custom elements
registerAll();
// Create and initialize the player
const player = new PublicAPI();
player.init({ source: 'youtube' });Configuration
| Option | Type | Description |
| ------------ | -------- | ------------------------------------------------ |
| source | string | Default media source ('youtube', 'html5') |
| autoplay | boolean| Start playback automatically |
| volume | number | Initial volume (0--1) |
| shuffle | boolean| Enable shuffle mode |
| repeat | string | Repeat mode ('none', 'one', 'all') |
For the full list of options, see the documentation.
Packages
This package re-exports everything from:
- @warmerdam-ai/core -- Engine, playlist management, event bus, DOM scanning
- @warmerdam-ai/ui -- Web Component UI layer (player shell, controls, playlist)
Most users only need to install @warmerdam-ai/webplayer. Use the sub-packages directly if you need finer-grained control over bundling.
Documentation
Full documentation is available at webplayer.warmerdam.ai/documentation.
License
MIT
