[Glitch] Run eslint --fix
I don't like it changing files this way, but it's basically what
c49213f0ea
and a few others did.
This commit is contained in:
@ -75,7 +75,7 @@ class Audio extends React.PureComponent {
|
||||
if (this.player) {
|
||||
this._setDimensions();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
_pack() {
|
||||
return {
|
||||
@ -107,11 +107,11 @@ class Audio extends React.PureComponent {
|
||||
|
||||
setSeekRef = c => {
|
||||
this.seek = c;
|
||||
}
|
||||
};
|
||||
|
||||
setVolumeRef = c => {
|
||||
this.volume = c;
|
||||
}
|
||||
};
|
||||
|
||||
setAudioRef = c => {
|
||||
this.audio = c;
|
||||
@ -120,14 +120,14 @@ class Audio extends React.PureComponent {
|
||||
this.audio.volume = 1;
|
||||
this.audio.muted = false;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
setCanvasRef = c => {
|
||||
this.canvas = c;
|
||||
|
||||
this.visualizer.setCanvas(c);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
componentDidMount () {
|
||||
window.addEventListener('scroll', this.handleScroll);
|
||||
window.addEventListener('resize', this.handleResize, { passive: true });
|
||||
@ -169,7 +169,7 @@ class Audio extends React.PureComponent {
|
||||
} else {
|
||||
this.setState({ paused: true }, () => this.audio.pause());
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
handleResize = debounce(() => {
|
||||
if (this.player) {
|
||||
@ -187,7 +187,7 @@ class Audio extends React.PureComponent {
|
||||
}
|
||||
|
||||
this._renderCanvas();
|
||||
}
|
||||
};
|
||||
|
||||
handlePause = () => {
|
||||
this.setState({ paused: true });
|
||||
@ -195,7 +195,7 @@ class Audio extends React.PureComponent {
|
||||
if (this.audioContext) {
|
||||
this.audioContext.suspend();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
handleProgress = () => {
|
||||
const lastTimeRange = this.audio.buffered.length - 1;
|
||||
@ -203,7 +203,7 @@ class Audio extends React.PureComponent {
|
||||
if (lastTimeRange > -1) {
|
||||
this.setState({ buffer: Math.ceil(this.audio.buffered.end(lastTimeRange) / this.audio.duration * 100) });
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
toggleMute = () => {
|
||||
const muted = !this.state.muted;
|
||||
@ -213,7 +213,7 @@ class Audio extends React.PureComponent {
|
||||
this.gainNode.gain.value = muted ? 0 : this.state.volume;
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
toggleReveal = () => {
|
||||
if (this.props.onToggleVisibility) {
|
||||
@ -221,7 +221,7 @@ class Audio extends React.PureComponent {
|
||||
} else {
|
||||
this.setState({ revealed: !this.state.revealed });
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
handleVolumeMouseDown = e => {
|
||||
document.addEventListener('mousemove', this.handleMouseVolSlide, true);
|
||||
@ -233,14 +233,14 @@ class Audio extends React.PureComponent {
|
||||
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
}
|
||||
};
|
||||
|
||||
handleVolumeMouseUp = () => {
|
||||
document.removeEventListener('mousemove', this.handleMouseVolSlide, true);
|
||||
document.removeEventListener('mouseup', this.handleVolumeMouseUp, true);
|
||||
document.removeEventListener('touchmove', this.handleMouseVolSlide, true);
|
||||
document.removeEventListener('touchend', this.handleVolumeMouseUp, true);
|
||||
}
|
||||
};
|
||||
|
||||
handleMouseDown = e => {
|
||||
document.addEventListener('mousemove', this.handleMouseMove, true);
|
||||
@ -254,7 +254,7 @@ class Audio extends React.PureComponent {
|
||||
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
}
|
||||
};
|
||||
|
||||
handleMouseUp = () => {
|
||||
document.removeEventListener('mousemove', this.handleMouseMove, true);
|
||||
@ -264,7 +264,7 @@ class Audio extends React.PureComponent {
|
||||
|
||||
this.setState({ dragging: false });
|
||||
this.audio.play();
|
||||
}
|
||||
};
|
||||
|
||||
handleMouseMove = throttle(e => {
|
||||
const { x } = getPointerPosition(this.seek, e);
|
||||
@ -282,7 +282,7 @@ class Audio extends React.PureComponent {
|
||||
currentTime: this.audio.currentTime,
|
||||
duration: this.audio.duration,
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
handleMouseVolSlide = throttle(e => {
|
||||
const { x } = getPointerPosition(this.volume, e);
|
||||
@ -317,11 +317,11 @@ class Audio extends React.PureComponent {
|
||||
|
||||
handleMouseEnter = () => {
|
||||
this.setState({ hovered: true });
|
||||
}
|
||||
};
|
||||
|
||||
handleMouseLeave = () => {
|
||||
this.setState({ hovered: false });
|
||||
}
|
||||
};
|
||||
|
||||
handleLoadedData = () => {
|
||||
const { autoPlay, currentTime } = this.props;
|
||||
@ -333,7 +333,7 @@ class Audio extends React.PureComponent {
|
||||
if (autoPlay) {
|
||||
this.togglePlay();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
_initAudioContext () {
|
||||
const AudioContext = window.AudioContext || window.webkitAudioContext;
|
||||
@ -367,7 +367,7 @@ class Audio extends React.PureComponent {
|
||||
}).catch(err => {
|
||||
console.error(err);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
_renderCanvas () {
|
||||
requestAnimationFrame(() => {
|
||||
@ -438,7 +438,7 @@ class Audio extends React.PureComponent {
|
||||
e.stopPropagation();
|
||||
this.togglePlay();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
handleKeyDown = e => {
|
||||
switch(e.key) {
|
||||
@ -463,7 +463,7 @@ class Audio extends React.PureComponent {
|
||||
this.seekBy(10);
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
render () {
|
||||
const { src, intl, alt, editable, autoPlay, sensitive, blurhash } = this.props;
|
||||
|
Reference in New Issue
Block a user