소스 검색

Fixed Audio module playback filename containing hashtag bug

Toby Chui 3 년 전
부모
커밋
6b304f29b1
1개의 변경된 파일9개의 추가작업 그리고 3개의 파일을 삭제
  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){