[CORS] Issue with SL app [SOLVED] | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

[CORS] Issue with SL app [SOLVED]

Hi amigos. Can you please check this code and help me, if you know how to fix it? Access to sound files using the Android app generates a CORS error. https://code.sololearn.com/WtotPruSBLLS

17th Jun 2018, 5:22 PM
Kustaa
4 Answers
+ 11
var sound = new Howl( { src: ["https://cors-anywhere.herokuapp.com/"+mp3Files[item]] });
17th Jun 2018, 9:22 PM
Burey
Burey - avatar
+ 9
gladly it's quite the common issue there are other services like cors-anywhere but so far it has been the best one for me p.s thanks for tagging as SOLVED >:D
18th Jun 2018, 5:22 AM
Burey
Burey - avatar
+ 8
replace the current var sound = new Howl..... with the code above this will eliminate the CORS issue (this service might not have 100% availablity but it's usually alright)
17th Jun 2018, 9:23 PM
Burey
Burey - avatar
+ 5
Well, that did it my friend. Credits to you, and very much appreciated your kind help.
17th Jun 2018, 10:07 PM
Kustaa