UNPKG

react-jplayer

Version:

Html5 audio and video player library for React

21 lines (16 loc) 484 B
import { connectWithId } from 'react-jplayer-utils'; import { compose, withHandlers } from 'recompose'; import { setOption } from '../../actions/actions'; import Repeat from './repeat'; const mapStateToProps = ({ jPlayers }, { id }) => ({ loop: jPlayers[id].loop, }); const handlers = { loop: props => () => props.setOption(props.id, 'loop', !props.loop), }; export default compose( connectWithId(mapStateToProps, { setOption, }), withHandlers(handlers), )(Repeat);