https://github.com/domchristie/play-list
A no-UI Web Component for coordinating lists of HTML media elements (`<audio>` or `<video>`)
https://github.com/domchristie/play-list
Last synced: 2 months ago
JSON representation
A no-UI Web Component for coordinating lists of HTML media elements (`<audio>` or `<video>`)
- Host: GitHub
- URL: https://github.com/domchristie/play-list
- Owner: domchristie
- License: mit
- Created: 2024-02-17T10:26:55.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-02-17T10:31:44.000Z (over 1 year ago)
- Last Synced: 2025-02-13T01:43:54.742Z (4 months ago)
- Language: JavaScript
- Size: 4.88 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ``
A no-UI Web Component for coordinating lists of HTML media elements (`` or ``).- Automatically plays the next element when the current one ends
- Pauses the current element when another one starts## Usage
```html
…```
## Attributes
The following HTML attributes are supported on the `` element:### `autoplay` (default: `true`)
Controls whether the next element will play when the current one finishes. Disable autoplay with `autoplay="false"`.### `loop` (default: `false`)
Controls whether to loop back round to the first element when the last one ends. Enable looping with by adding an empty `loop` attribute, or with `loop="true"`.## Properties
The `` element includes the following properties:### `autoplay` (default: `true`)
Get or set the `autoplay` attribute.### `loop` (default: `false`)
Get or set the `loop` attribute.### `elements`
An array of `audio` and `video` elements in the list.### `current`
The most recently started media element.## Methods
### `next()`
Play the next element in the list.## License
Copyright © 2024+ Dom Christie and released under the MIT license.