fix js variable reference error on loading the audio player component
This commit is contained in:
parent
6368897b21
commit
04a7445f68
|
|
@ -110,7 +110,6 @@ const JKAudioPlayer = ({ audioUrl }) => {
|
|||
audioPlayer.current.querySelector(".controls .volume-percentage").style.width = volume * 100 + '%';
|
||||
}
|
||||
|
||||
|
||||
function getTimeCodeFromNum(num) {
|
||||
let seconds = parseInt(num);
|
||||
let minutes = parseInt(seconds / 60);
|
||||
|
|
@ -125,6 +124,7 @@ const JKAudioPlayer = ({ audioUrl }) => {
|
|||
}
|
||||
|
||||
return (
|
||||
audioUrl && audio && (
|
||||
<div className="audio-player" ref={audioPlayer}>
|
||||
|
||||
<div className="controls">
|
||||
|
|
@ -132,7 +132,6 @@ const JKAudioPlayer = ({ audioUrl }) => {
|
|||
<button
|
||||
onClick={togglePlayPause}
|
||||
className="play-pause-button"
|
||||
|
||||
>
|
||||
{isPlaying ? (
|
||||
<img src={pauseIcon} alt="Pause" width="30" />
|
||||
|
|
@ -168,6 +167,8 @@ const JKAudioPlayer = ({ audioUrl }) => {
|
|||
</div>
|
||||
</div>
|
||||
)
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
export default JKAudioPlayer
|
||||
Loading…
Reference in New Issue