We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a060d3f commit f37c3aeCopy full SHA for f37c3ae
music_html5.c
@@ -340,25 +340,8 @@ static void *MusicHTML5_CreateFromFile(const char *file)
340
url = Module["SDL2Mixer"].createBlob(buf);
341
} catch(e) {
342
// Fail silently, presume file not in FS.
343
- // Assume it's a URL
344
- function isValidUrl(string) {
345
- let url;
346
-
347
- try {
348
- url = new URL(string);
349
- } catch (_) {
350
- return false;
351
- }
352
353
- return url.protocol === "http:" || url.protocol === "https:";
354
355
356
- if (isValidUrl(file))
357
- url = file;
358
- else {
359
- Module["printErr"](`URL ${url} is invalid`);
360
- return -1;
361
+ // Assume it's a relative or absolute URL
+ url = file;
362
}
363
364
const id = Module["SDL2Mixer"].createMusic(url, context);
0 commit comments