diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2018-06-03 14:46:18 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2018-06-03 14:46:18 +0200 |
| commit | a450fa75edb927b7568b8a3198f9209c6a4c7f79 (patch) | |
| tree | 67a9baa716c6f12f2ed3a8e4ba69e942fb309687 /app/client/common/audioPlayer.component.js | |
| parent | 198c41778cfe39d37aab92c08325dc8c9d4437a0 (diff) | |
adjusting the form, calling samplernn tasks
Diffstat (limited to 'app/client/common/audioPlayer.component.js')
| -rw-r--r-- | app/client/common/audioPlayer.component.js | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/app/client/common/audioPlayer.component.js b/app/client/common/audioPlayer.component.js new file mode 100644 index 0000000..f10a505 --- /dev/null +++ b/app/client/common/audioPlayer.component.js @@ -0,0 +1,38 @@ +import { h, Component } from 'preact' +import { connect } from 'react-redux' +import { bindActionCreators } from 'redux' +import * as liveActions from '../live/live.actions' + +const audio = document.createElement('audio') + +class AudioPlayer extends Component { + constructor(props){ + super(props) + this.handleClick = this.handleClick.bind(this) + } + handleClick(e){ + this.props.onClick && this.props.onClick() + } + render() { + const { player={} } = this.props + return ( + <div className='audioPlayer'> + <span>{this.props.title}</span> + <button + onClick={this.handleClick} + > + {player.playing ? '>' : 'pause'} + </button> + </div> + ) + } +} + +const mapStateToProps = state => ({ + player: state.audioPlayer, +}) + +const mapDispatchToProps = (dispatch, ownProps) => ({ +}) + +export default connect(mapStateToProps, mapDispatchToProps)(AudioPlayer) |
