From 38963479bccf8397b0e93399f72c3a3590866d0c Mon Sep 17 00:00:00 2001 From: KatieFrogs <23621460+KatieFrogs@users.noreply.github.com> Date: Sat, 5 Mar 2022 08:39:16 +0300 Subject: [PATCH] Fix some ogg urls not working on iOS --- public/src/js/abstractfile.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/public/src/js/abstractfile.js b/public/src/js/abstractfile.js index 9855687..f3c49f6 100644 --- a/public/src/js/abstractfile.js +++ b/public/src/js/abstractfile.js @@ -33,10 +33,17 @@ class RemoteFile{ if(this.path.startsWith("/")){ this.path = this.path.slice(1) } - this.name = this.path - var index = this.name.lastIndexOf("/") - if(index !== -1){ - this.name = this.name.slice(index + 1) + if(this.url.startsWith("data:")){ + this.name = "datauri" + if(this.url.startsWith("data:audio/ogg")){ + this.name += ".ogg" + } + }else{ + this.name = this.path + var index = this.name.lastIndexOf("/") + if(index !== -1){ + this.name = this.name.slice(index + 1) + } } } arrayBuffer(){