Skip to content

Commit

Permalink
fixed volume component
Browse files Browse the repository at this point in the history
  • Loading branch information
souporserious committed Aug 5, 2015
1 parent be815eb commit 5aa7ed9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ React media container component to help build video & audio players.
## TODOS

- [x] Fix Progress component
- [] Fix Volume getting locked up when player is muted
- [x] Fix Volume getting locked up when player is muted
- [] Playlist feature
- [] Show time preview when hovering scrubber
- [] Show thumbnail preview when hovering scrubber
Expand Down
18 changes: 14 additions & 4 deletions src/controls/Volume.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,14 @@ class Volume {
dragging = false

_handleChange(e) {
const { player } = this.props;
player.volume = (+e.target.value).toFixed(4);

let { muted, volume } = this.props.player;

if(muted) {
muted = false;
}

volume = (+e.target.value).toFixed(4);
}

_handleDragging() {
Expand All @@ -15,11 +21,15 @@ class Volume {

_handleDrag(e) {

const { player } = this.props;
let { muted, volume } = this.props.player;

if(this.dragging) {

player.volume = (+e.target.value).toFixed(4);
if(muted) {
muted = false;
}

volume = (+e.target.value).toFixed(4);

if(e.type === 'mouseup') {
this.dragging = false;
Expand Down

0 comments on commit 5aa7ed9

Please sign in to comment.