]> littlesong.place Git - littlesongplace.git/commitdiff
Fix player button colors bug on iOS
authorChris Fulljames <christianfulljames@gmail.com>
Fri, 27 Jun 2025 10:50:48 +0000 (06:50 -0400)
committerChris Fulljames <christianfulljames@gmail.com>
Fri, 27 Jun 2025 10:52:41 +0000 (06:52 -0400)
(#22) This forces a gif color refresh after any player updates.  Probably adds a performance hit, but seems to be the only workaround.

src/littlesongplace/static/player.js

index 93fe8117a56131ef5af3e233c3a05245b793bf3b..9cc80cc49e96bcf493ebb097a98feb81821467ed 100644 (file)
@@ -106,6 +106,7 @@ function playCurrentSong() {
 function showBigPlayer() {
     document.getElementById("mini-player").hidden = true;
     document.getElementById("player").hidden = false;
+    updateImageColors();
 }
 
 function showMiniPlayer(event) {
@@ -115,6 +116,7 @@ function showMiniPlayer(event) {
         bigPlayer.hidden = true;
         document.getElementById("mini-player").hidden = false;
     }
+    updateImageColors();
 }
 
 // Play or pause the current song in the player
@@ -205,6 +207,7 @@ document.addEventListener("DOMContentLoaded", (event) => {
         button.src = customImage(document.getElementById("lsp_btn_pause02"), button);
         miniButton.className = "lsp_btn_pause02";
         miniButton.src = customImage(document.getElementById("lsp_btn_pause02"), button);
+        updateImageColors();
     })
 
     // Show play button when audio is paused
@@ -213,6 +216,7 @@ document.addEventListener("DOMContentLoaded", (event) => {
         button.src = customImage(document.getElementById("lsp_btn_play02"), button);
         miniButton.className = "lsp_btn_play02";
         miniButton.src = customImage(document.getElementById("lsp_btn_play02"), button);
+        updateImageColors();
     })
 
     // Audio position scrubbing