Fix some ogg urls not working on iOS

This commit is contained in:
KatieFrogs 2022-03-05 08:39:16 +03:00
parent 6f984e6588
commit 38963479bc

View File

@ -33,12 +33,19 @@ class RemoteFile{
if(this.path.startsWith("/")){ if(this.path.startsWith("/")){
this.path = this.path.slice(1) this.path = this.path.slice(1)
} }
if(this.url.startsWith("data:")){
this.name = "datauri"
if(this.url.startsWith("data:audio/ogg")){
this.name += ".ogg"
}
}else{
this.name = this.path this.name = this.path
var index = this.name.lastIndexOf("/") var index = this.name.lastIndexOf("/")
if(index !== -1){ if(index !== -1){
this.name = this.name.slice(index + 1) this.name = this.name.slice(index + 1)
} }
} }
}
arrayBuffer(){ arrayBuffer(){
return loader.ajax(this.url, request => { return loader.ajax(this.url, request => {
request.responseType = "arraybuffer" request.responseType = "arraybuffer"