riddhiman commited on
Commit
ecb069e
·
verified ·
1 Parent(s): 0dc1f69

Update public/script.js

Browse files
Files changed (1) hide show
  1. public/script.js +0 -14
public/script.js CHANGED
@@ -231,20 +231,6 @@ function playMusic(fileName) {
231
  audio.play(); // Start playback
232
  };
233
 
234
- // Updated onended event handler within playMusic function
235
- audio.onended = () => {
236
- if (isLooping) {
237
- // Replay the current song
238
- audio.currentTime = 0;
239
- audio.play();
240
- } else {
241
- const currentIndex = trackList.indexOf(currentPlaying);
242
- if (currentIndex !== -1 && currentIndex < trackList.length - 1) {
243
- playMusic(trackList[currentIndex + 1]);
244
- }
245
- }
246
- };
247
-
248
  audio.onerror = () => {
249
  isLoadingMusic = false;
250
  alert(`Error loading the music: ${fileName}`);
 
231
  audio.play(); // Start playback
232
  };
233
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
234
  audio.onerror = () => {
235
  isLoadingMusic = false;
236
  alert(`Error loading the music: ${fileName}`);