From e17ce855e39e2009b8bd490f2660b6519717b3b4 Mon Sep 17 00:00:00 2001
From: Raunak Raj <71929976+bajrangCoder@users.noreply.github.com>
Date: Thu, 9 Jan 2025 20:45:06 +0530
Subject: [PATCH] fix: use Ref instead of querrySelector follow up #1136
---
src/components/audioPlayer/index.js | 104 +++++++++++++++++-----------
1 file changed, 62 insertions(+), 42 deletions(-)
diff --git a/src/components/audioPlayer/index.js b/src/components/audioPlayer/index.js
index 33b552dd0..ebc8c73f8 100644
--- a/src/components/audioPlayer/index.js
+++ b/src/components/audioPlayer/index.js
@@ -1,62 +1,80 @@
import "./style.scss";
+import Ref from "html-tag-js/ref";
export default class AudioPlayer {
constructor(container) {
this.container = container;
this.audio = new Audio();
this.isPlaying = false;
+ this.elements = {
+ playBtn: new Ref(),
+ playIcon: new Ref(),
+ timeline: new Ref(),
+ progress: new Ref(),
+ progressHandle: new Ref(),
+ timeDisplay: new Ref(),
+ duration: new Ref(),
+ volumeBtn: new Ref(),
+ };
this.initializeUI();
this.initializeEvents();
this.cleanup = this.cleanup.bind(this);
}
initializeUI() {
- const auidoPlayer = (
+ const audioPlayer = (
-