Accessible audio component.
npm install @10up/component-audio> NOTE: This is a very initial pass. Recommend waiting on first usage until fully tested. Updates coming shortly.
  [![Build Status][cli-img]][cli-url]
[cli-img]: https://github.com/10up/component-accordion/workflows/Automated%20Tests/badge.svg
[cli-url]: https://github.com/10up/component-accordion/actions?query=workflow%3A%22Automated+Tests%22
npm install --save @10up/component-audio
Clone this repo and import audio.js and audio.css from the dist/ directory.
onplay: (playerInstance) => {}
onpause: (playerInstance) => {}
onerror: (playerInstance) => {}
onloadstart: (playerInstance) => {}
onended: (playerInstance) => {}
onplaying: (playerInstance) => {}
onprogress: (playerInstance) => {}
onseeking: (playerInstance) => {}
onseeked: (playerInstance) => {}
ontimeupdate: (playerInstance) => {}
onvolumechange: (playerInstance) => {}
| Property | Default value | Type | Usage |
|-|-|-|-|
| playLabel | Play | String | Label for the play button |
| playLabel | Stop | String | Label for the stop button |
| stopLabel | Stop | String | Label for the pause button |
| pauseLabel | Pause | String | Label for the mute button |
| muteLabel | Mute | String | Label for the mute button |
| volumeLabel | Volume | String | Label for the volume slider |
| scrubberLabel | Scrub Timeline | String | Label for the scrubber slider |
| currentTimeLabel | Total Time | String | Label for the total time |
| showMute | true | Boolean | Maybe show the mute button |
| showStop | true | Boolean | Maybe show the stop button |
| showTimer | true | Boolean | Maybe show the timer control |
| showVolume | true | Boolean | Maybe show the volume slider |
| showScrubber | true | Boolean | Maybe show the scrubber control |
| localStorage | true | Boolean | Maybe enable localStorage. This allows a user to reload the page, and pickup where they last left off. |
| debug | true | Boolean | Maybe turn on debug mode. Debug mode outputs helpful information in the console window of the browser. |
This is the markup template expected by the component. Use an HTML audio player, wrapped with an element containing a class. Here we use a div with a class of 'audio'.
``html`
$3
Create a new instance by supplying the selector to use for the audio and an object containing any necessary callback functions.
`javascript
import Audio from '@10up/component-audio';
const audioInstance = new Audio( '.audio', { ...options } );
``
Coming soon
Coming soon
Coming soon
Active: 10up is actively working on this, and we expect to continue work for the foreseeable future including keeping tested up to the most recent version of WordPress. Bug reports, feature requests, questions, and pull requests are welcome.