Skip to content

Commit

Permalink
document useAudioObject prop
Browse files Browse the repository at this point in the history
  • Loading branch information
souporserious committed Oct 4, 2018
1 parent db96214 commit a660c71
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ Autoplay media when the component is mounted or `src` changes.

Loop the current `src` indefinitely.

#### `useAudioObject`: PropTypes.bool

When playing HTML5 `audio`, it will construct audio using the
[`Audio`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLAudioElement#Constructor)
class instead of rendering an element to the page.

#### `connectSource`: PropTypes.func(source, audioContext)

A chance to connect a series of
Expand Down
5 changes: 4 additions & 1 deletion src/vendors/HTML5.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ import vendorPropTypes from './vendor-prop-types'
const audioContext = new (window.AudioContext || window.webkitAudioContext)()

class HTML5 extends Component {
static propTypes = vendorPropTypes
static propTypes = {
...vendorPropTypes,
useAudioObject: PropTypes.bool,
}

get instance() {
return this._player
Expand Down

0 comments on commit a660c71

Please sign in to comment.