J
jsterj
Guest
I am unable to do a simple file download of an OGG file when running in HTML5. It works perfectly when testing locally (i.e. not HTML5)
Below is the code. I moved it into an empty test project to rule out any other factors.
I have a single object in a room. In the create event I have the following:
Then in the ASYNC - HTTP event I have:
The console shows the following:
I don't know what the "too many arguments" message is referring to. The JavaScript is obfuscated, so not much help. It's referring to this line:
versus when tested locally I get this output(i.e. all works fine):
I tested the same code but using a simple TXT file and it worked fine. I DO NOT want to include the music files in the game bundle. There are going to be many and load times would just be too long. If anyone knows a better method than what I'm doing, please let me know.
Any help would be greatly appreciated. I've searched all over for a solution, tried a thousand different approaches, and have come up empty.
Thanks,
Justin
Below is the code. I moved it into an empty test project to rule out any other factors.
I have a single object in a room. In the create event I have the following:
GML:
musicFile = http_get_file("https://example.com/music/SomeMusicFile.ogg", "SomeMusicFile.ogg");
Then in the ASYNC - HTTP event I have:
GML:
if(ds_map_find_value(async_load, "id") == musicFile)
{
var status = ds_map_find_value(async_load, "status");
show_debug_message("status: " + string(status));
show_debug_message("http status: " + string(ds_map_find_value(async_load, "http_status")));
if(status == 0) {
show_debug_message("yeah, status is 0");
}
}
The console shows the following:
Code:
too many arguments provided for a function call test.js:183:409
status: -1
http status: 200
JavaScript:
if(_Fr._h2._C2)console.log(text);
Code:
status: 1
http status: undefined
status: 1
http status: undefined
status: 0
http status: 200
yeah, status is 0
I tested the same code but using a simple TXT file and it worked fine. I DO NOT want to include the music files in the game bundle. There are going to be many and load times would just be too long. If anyone knows a better method than what I'm doing, please let me know.
Any help would be greatly appreciated. I've searched all over for a solution, tried a thousand different approaches, and have come up empty.
Thanks,
Justin