Browse Source

Fixed Audio module playback filename containing hashtag bug

Toby Chui 3 years ago
parent
commit
6b304f29b1
1 changed files with 9 additions and 3 deletions
  1. 9 3
      web/Music/index.html

+ 9 - 3
web/Music/index.html

@@ -1351,9 +1351,15 @@
 
 	function loadAndPlayAudioFile(sourceURL,playAfterLoad = true){
 		var audio = audioElement;
-		sourceURL = "../" + sourceURL; //Convert absolute dir to relative
-		$("#mainAudioPlayer").attr("src", sourceURL);
-		//console.log(encodeURIComponent(sourceURL));
+
+		//These was added to fix the legacy file listing issue
+		var fd = sourceURL.split("=");
+		var rootPath = fd.shift();
+		var filename = fd.join("=");
+		var playbackURL = "../" + rootPath + "=" + encodeURIComponent(filename); //Convert absolute dir to relative
+		//console.log(playbackURL);
+		$("#mainAudioPlayer").attr("src", playbackURL);
+
         audio[0].pause();
         audio[0].load();
         if(playAfterLoad){