Skip to content

Commit

Permalink
chore: Get rid of dead code. #1601
Browse files Browse the repository at this point in the history
  • Loading branch information
mturoci committed Aug 10, 2023
1 parent bd80a0d commit 1abf829
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions ui/src/audio_annotator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -162,18 +162,14 @@ export const XAudioAnnotator = ({ model }: { model: AudioAnnotator }) => {
}
},
onAudioEnded = () => setIsPlaying(false),
onTrackChange = (value: F, _range?: [F, F], e?: unknown) => skipToTime(value)(e as any),
onTrackChange = (value: F, _range?: [F, F]) => skipToTime(value)(),
onVolumeChange = (v: F) => {
if (gainNodeRef.current) gainNodeRef.current.gain.value = v
setVolumeIcon(v === 0 ? 'VolumeDisabled' : (v < 0.3 ? 'Volume1' : (v < 0.75 ? 'Volume2' : 'Volume3')))
},
onSpeedChange = (v: U) => { if (audioRef.current) audioRef.current.playbackRate = v },
skipToTime = (newTime?: F) => (e: React.MouseEvent<HTMLCanvasElement>) => {
skipToTime = (newTime: F) => () => {
if (!audioRef.current) return
if (newTime === undefined) {
const xRelativeToCurrTarget = (e.pageX || 0) - e.currentTarget.getBoundingClientRect().left
newTime = xRelativeToCurrTarget / e.currentTarget.width * duration
}
setCurrentTime(newTime)
audioRef.current.currentTime = newTime
},
Expand Down

0 comments on commit 1abf829

Please sign in to comment.