summaryrefslogtreecommitdiff
path: root/app/client/common/audioPlayer.component.js
diff options
context:
space:
mode:
Diffstat (limited to 'app/client/common/audioPlayer.component.js')
-rw-r--r--app/client/common/audioPlayer.component.js38
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)