Volume props is not working
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 490
- Forks
- 80
- PR merge metrics
- No merged PRs in 30d
Description
I am trying to control the volume of react-sound but, it looks alike volume props is not being accepted by component. here is the same code which I wrote and your NPM props.
My code:
this.state = {
volume: 10
}
<Sound
url={this.prepareUrl(this.state.track.stream_url)}
playStatus={this.state.playStatus}
onPlaying={this.handleSongPlaying.bind(this)}
playFromPosition={this.state.playFromPosition}
volume={this.state.volume}
onPause={() => console.log('Paused')}
onResume={() => console.log('Resumed')}
onStop={() => console.log('Stopped')}
onFinishedPlaying={this.handleSongFinished.bind(this)}/>
<Player
onVolumeUp={() => this.setState({volume: volume >= 100 ? volume : volume+10})}
onVolumeDown={() => this.setState({volume: volume <= 0 ? volume : volume-10})}
/>
Evan these log is not working.
Some props from your NPM :
{
key: 'propTypes',
value: {
url: _react.PropTypes.string.isRequired,
playStatus: _react.PropTypes.oneOf(Object.keys(playStatuses)).isRequired,
position: _react.PropTypes.number,
playFromPosition: _react.PropTypes.number,
onLoading: _react.PropTypes.func,
onPlaying: _react.PropTypes.func,
onFinishedPlaying: _react.PropTypes.func
},
enumerable: true
}, {
key: 'defaultProps',
value: {
playFromPosition: 0,
onLoading: noop,
onPlaying: noop,
onFinishedPlaying: noop
},
enumerable: true
}
can you please help me to understand this why I am not able to control the sound. am I missing something or something else?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the Sound and Player entry points shown in the issue, then compare the documented props with the component's propTypes and defaultProps. Reproduce the volume update using the supplied example and check whether the callbacks change the state passed to Sound. Done means the documented volume control changes playback as expected, with the relevant behavior covered by an existing or added test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100