|
|
|
@ -217,8 +217,9 @@ class Video extends PureComponent {
|
|
|
|
|
const { x } = getPointerPosition(this.volume, e);
|
|
|
|
|
|
|
|
|
|
if(!isNaN(x)) {
|
|
|
|
|
this.setState({ volume: x }, () => {
|
|
|
|
|
this.setState((state) => ({ volume: x, muted: state.muted && x === 0 }), () => {
|
|
|
|
|
this.video.volume = x;
|
|
|
|
|
this.video.muted = this.state.muted;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}, 15);
|
|
|
|
@ -425,10 +426,11 @@ class Video extends PureComponent {
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
toggleMute = () => {
|
|
|
|
|
const muted = !this.video.muted;
|
|
|
|
|
const muted = !(this.video.muted || this.state.volume === 0);
|
|
|
|
|
|
|
|
|
|
this.setState({ muted }, () => {
|
|
|
|
|
this.video.muted = muted;
|
|
|
|
|
this.setState((state) => ({ muted, volume: Math.max(state.volume || 0.5, 0.05) }), () => {
|
|
|
|
|
this.video.volume = this.state.volume;
|
|
|
|
|
this.video.muted = this.state.muted;
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|