Commit 9333ed24 authored by SpinShare's avatar SpinShare

fixed mp3 preview

parent eed43378
......@@ -382,10 +382,6 @@
function PlayPreview() {
currentPreviewAudio = new Audio("{{ asset('uploads/audio/' ~ song.fileReference ~ '_0.ogg') }}");
// TODO: This is a quick fix for mp3 support, change with proper code later
currentPreviewAudio.onerror = function() {
currentPreviewAudio = new Audio("{{ asset('uploads/audio/' ~ song.fileReference ~ '_0.mp3') }}");
}
currentPreviewAudio.volume = 0.5;
playerVolume.value = 50;
currentPreviewAudio.play();
......@@ -394,6 +390,15 @@
}
isPlaying = true;
// TODO: This is a quick fix for mp3 support, change with proper code later
currentPreviewAudio.onerror = function() {
currentPreviewAudio = new Audio("{{ asset('uploads/audio/' ~ song.fileReference ~ '_0.mp3') }}");
currentPreviewAudio.volume = 0.5;
playerVolume.value = 50;
currentPreviewAudio.play();
}
songActionsRow.classList.add("player-active");
playerToggle.innerHTML = '<i class="mdi mdi-stop"></i>';
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment