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

https://github.com/daviddarnes/sample-input

A Web Component to sample audio or video added to an upload input
https://github.com/daviddarnes/sample-input

component components customelement customelements webcomponent webcomponents

Last synced: 11 months ago
JSON representation

A Web Component to sample audio or video added to an upload input

Awesome Lists containing this project

README

          

# `sample-input`

A Web Component to sample audio or video added to an upload input

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

## Examples

General usage example:

```html


```

Example usage with the `capture` option to record live audio (not compatible with all hardware) and placeholder audio:

```html


```

## Features

This Web Component allows you to:

- Add an audio or video file that's been added via an upload input to an `audio` or `video` element so it can be previewed

## Installation

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

1. Install via [npm](https://www.npmjs.com/package/@daviddarnes/sample-input): `npm install @daviddarnes/sample-input`
1. [Download the source manually from GitHub](https://github.com/daviddarnes/sample-input/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="sample-input.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)