Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/daviddarnes/play-button

A Web Component to play audio or video with a button
https://github.com/daviddarnes/play-button

component components customelement customelements webcomponent webcomponents

Last synced: 3 months ago
JSON representation

A Web Component to play audio or video with a button

Awesome Lists containing this project

README

        

# `play-button`

A Web Component to play audio or video with a button.

**[Demo](https://daviddarnes.github.io/play-button/demo.html)** | **[Further reading](https://darn.es/play-button-web-component/)**

## Examples

```html


Play

```

## Features

This Web Component allows you to:

- Control `audio` or `video` elements with a single `button` which can play and pause the audio or video

## Installation

You have a few options (choose one of these):

1. Install via [npm](https://www.npmjs.com/package/@daviddarnes/play-button): `npm install @daviddarnes/play-button`
1. [Download the source manually from GitHub](https://github.com/daviddarnes/play-button/releases) into your project.
1. Skip this step and use the script directly via a 3rd party CDN (not recommended for production use)

### Usage

Make sure you include the `` in your project (choose one of these):

```html
<!-- Host yourself -->
<script type="module" src="play-button.js">
```

```html

```

```html

```

## Credit

With thanks to the following people:

- [Zach Leatherman](https://zachleat.com) for inspiring this [Web Component repo template](https://github.com/daviddarnes/component-template)