Skip to content

Commit 7ae00a3

Browse files
committed
fix: fix <Audio> autoPlay came-casing
1 parent 019ea09 commit 7ae00a3

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
React utility belt.
44

55
- Collection of React goodies
6-
- Isomorphic - all components work in the browser and in Node
6+
- Isomorphic - all components work in browser and Node
77
- [See demos and docs](https://mailonline.github.io/mol-fe-react/)
88

99
## Installation

docs/Audio.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ FaCC that creates an `<audio>` element to play audio tracks, re-renders on audio
77
```jsx
88
import {Audio} from 'mol-fe-react/lib/Audio';
99

10-
<Audio autoplay src='https://www.soundhelix.com/examples/mp3/SoundHelix-Song-2.mp3'>{(control, state) => {
10+
<Audio autoPlay src='https://www.soundhelix.com/examples/mp3/SoundHelix-Song-2.mp3'>{(control, state) => {
1111
JSON.stringify(state, null, 4)
1212
}}</Audio>
1313
```
@@ -19,7 +19,7 @@ In addition to props below also accepts all [React's media events](https://react
1919
```tsx
2020
export interface IAudioProps {
2121
src: string;
22-
autoplay?: boolean;
22+
autoPlay?: boolean;
2323
loop?: boolean;
2424
muted?: boolean;
2525
preload?: 'none' | 'metadata' | 'auto';
@@ -29,7 +29,7 @@ export interface IAudioProps {
2929
```
3030

3131
- `src` - required, string, audio source file URL.
32-
- `autoplay` - optional, boolean, whether to autoplay audio, defaults to `false`.
32+
- `autoPlay` - optional, boolean, whether to autoplay audio, defaults to `false`.
3333
- `loop` - optional, boolean, whether to repeat the track when it ends, defaults to `false`.
3434
- `muted` - optional, boolean, whether to mute the audio, defaults to `false`.
3535
- `preload` - optional, string, `<audio>` element preload attribute.

src/Audio/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export type TAudioEvent = (event, Audio, IAudioState) => void;
66
export interface IAudioProps {
77
src: string;
88
children?: (...args) => React.ReactElement<any>;
9-
autoplay?: boolean;
9+
autoPlay?: boolean;
1010
loop?: boolean;
1111
muted?: boolean;
1212
preload?: 'none' | 'metadata' | 'auto';
@@ -62,7 +62,7 @@ export class Audio extends Component<IAudioProps, IAudioState> {
6262
};
6363

6464
componentDidMount () {
65-
if (this.props.autoplay && this.el.paused) {
65+
if (this.props.autoPlay && this.el.paused) {
6666
this.play();
6767
}
6868

@@ -170,14 +170,14 @@ export class Audio extends Component<IAudioProps, IAudioState> {
170170

171171
render () {
172172
const {props, event} = this;
173-
const {children, src, autoplay, loop, muted, preload, volume, noJs = noop as any} = props;
173+
const {children, src, autoPlay, loop, muted, preload, volume, noJs = noop as any} = props;
174174

175175

176176
const audio = h('audio', {
177177
ref: this.ref,
178178
controls: false,
179179
src,
180-
autoplay,
180+
autoPlay,
181181
loop,
182182
muted,
183183
preload,

src/Audio/story.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const src = 'https://www.soundhelix.com/examples/mp3/SoundHelix-Song-2.mp3';
1010
storiesOf('Generators/Audio', module)
1111
.add('Documentation', () => h(ShowDocs, {name: 'Audio'}))
1212
.add('Example', () =>
13-
<Audio autoplay src={src}>{(audio) =>
13+
<Audio autoPlay src={src}>{(audio) =>
1414
<div>
1515
Hello audio!
1616
</div>

src/Vibrate/story.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {Vibrate} from '.';
66
import ShowDocs from '../../.storybook/ShowDocs'
77

88
storiesOf('Generators/Vibrate', module)
9-
.add('Documentation', () => h(ShowDocs, {name: 'SizeSensor'}))
9+
.add('Documentation', () => h(ShowDocs, {name: 'Vibrate'}))
1010
.add('One beep', () =>
1111
<div>
1212
<Vibrate ms={200} />

0 commit comments

Comments
 (0)