Skip to content

Commit

Permalink
migrate npm to yarn; add onVolumeChange; add svg style fix; add UMD
Browse files Browse the repository at this point in the history
  • Loading branch information
lhz516 committed Jun 16, 2020
1 parent bb5dc85 commit 705c67c
Show file tree
Hide file tree
Showing 12 changed files with 13,179 additions and 24,611 deletions.
28 changes: 16 additions & 12 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ module.exports = {
'eslint:recommended',
'plugin:react/recommended',
'plugin:jsx-a11y/recommended',
'plugin:@typescript-eslint/recommended', // Uses the recommended rules from the @typescript-eslint/eslint-plugin
'prettier/@typescript-eslint', // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier
'plugin:prettier/recommended', // Enables eslint-plugin-prettier and displays prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
'plugin:@typescript-eslint/recommended', // Uses the recommended rules from the @typescript-eslint/eslint-plugin
'prettier/@typescript-eslint', // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier
'plugin:prettier/recommended', // Enables eslint-plugin-prettier and displays prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
],
parserOptions: {
sourceType: 'module',
Expand All @@ -23,13 +23,16 @@ module.exports = {
},
},
rules: {
'prettier/prettier': [2, {
printWidth: 120,
singleQuote: true,
semi: false,
arrowParens: 'always',
trailingComma: 'es5'
}],
'prettier/prettier': [
2,
{
printWidth: 120,
singleQuote: true,
semi: false,
arrowParens: 'always',
trailingComma: 'es5',
},
],
'arrow-parens': [2, 'always'],
camelcase: [2, { properties: 'never' }],
curly: [2, 'multi-line'],
Expand Down Expand Up @@ -101,6 +104,7 @@ module.exports = {
'prefer-const': 2,
'prefer-arrow-callback': 2,
'template-curly-spacing': [2, 'never'],
'@typescript-eslint/ban-ts-comment': 0,
},
overrides: [
{
Expand All @@ -109,7 +113,7 @@ module.exports = {
'@typescript-eslint/ban-ts-ignore': 0,
'@typescript-eslint/no-empty-function': 0,
'@typescript-eslint/explicit-function-return-type': 0,
}
}
},
},
],
}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ lib/
es/
react-h5-audio-player-storybook/
coverage/
.vscode/
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

Live Demo: [Storybook](https://static.hanzluo.com/react-h5-audio-player-storybook/index.html?path=/docs/layouts--default-story)

Website example: [hanzluo.com](https://hanzluo.com/#music) | [Code](https://github.com/lhz516/hanzluo/blob/master/src/components/home/home.js#L279)
Try it on CodePen: [codepen.io/lhz516/pen/dyGpmgP](https://codepen.io/lhz516/pen/dyGpmgP)

Supported browsers: Chrome, Firefox, Safari, Opera, Edge, IE 11

Expand Down Expand Up @@ -122,6 +122,7 @@ The `controls` attribute defaults to `false` and should never be changed to `tru
| onClickNext | Function (Event) | null | Called when click Next button |
| onPlayError | Function (Error) | null | Called when there's error invoking `audio.play()`, it captures error that `onError` won't catch |
| onListen | Function (Event) | null | Called every `listenInterval` milliseconds during playback |
| onVolumeChange | Function (Event) | null | Called when volume is changed. Get volume by `e.target.volume` |
| onPlay | Function (Event) | null | Called when user plays the audio |
| onPause | Function (Event) | null | Called when user pauses the audio |
| onAbort | Function (Event) | null | Called when unloading the audio player, like when switching to a different src file |
Expand Down
Loading

0 comments on commit 705c67c

Please sign in to comment.