1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-25 04:46:40 +07:00

simple player controls

This commit is contained in:
Fedor Katurov 2019-10-13 18:43:42 +07:00
parent 3fcff3ea0d
commit 69ff9a7652
8 changed files with 128 additions and 25 deletions

View file

@ -5,6 +5,9 @@ import * as PLAYER_ACTIONS from '~/redux/player/actions';
import { IFile } from '~/redux/types';
import { PLAYER_STATES } from '~/redux/player/constants';
import { Player } from '~/utils/player';
import classNames from 'classnames';
import * as styles from './styles.scss';
import { Icon } from '~/components/input/Icon';
const mapStateToProps = state => ({
player: selectPlayer(state),
@ -61,8 +64,16 @@ const AudioPlayerUnconnected = ({
}, [file, current, setPlaying, onProgress]);
return (
<div onClick={onPlay}>
- {file.url} - {progress} - {playing && 'playing'}
<div onClick={onPlay} className={classNames(styles.wrap, { playing })}>
<div className={styles.playpause}>
{playing && status === PLAYER_STATES.PLAYING ? <Icon icon="pause" /> : <Icon icon="play" />}
</div>
<div className={styles.content}>
<div className={styles.progress}>
<div className={styles.bar} style={{ width: `${progress}%` }} />
</div>
<div className={styles.title}>{file.url}</div>
</div>
</div>
);
};