Skip to content

Commit 21fb842

Browse files
committed
Use Module.printErr instead of console.error
1 parent 51453b0 commit 21fb842

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

music_html5.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ static int MusicHTML5_Open(const SDL_AudioSpec *spec)
213213
if (!(audio instanceof HTMLMediaElement))
214214
return;
215215

216-
console.error("Error " + audio.error.code + "; details: " + audio.error.message);
216+
Module["printErr"]("Error " + audio.error.code + "; details: " + audio.error.message);
217217

218218
// Reset to defaults
219219
this.resetMusicState(audio);
@@ -351,7 +351,7 @@ static void *MusicHTML5_CreateFromFile(const char *file)
351351
if (isValidUrl(file))
352352
url = file;
353353
else {
354-
console.error(`URL ${url} is invalid`);
354+
Module["printErr"](`URL ${url} is invalid`);
355355
return -1;
356356
}
357357
}
@@ -418,9 +418,9 @@ static int MusicHTML5_Play(void *context, int play_count)
418418

419419
// Older browsers do not return a Promise
420420
if (played)
421-
played.catch((e) => console.error(e));
421+
played.catch((e) => Module["printErr"](e));
422422
} catch (e) {
423-
console.error(e);
423+
Module["printErr"](e);
424424
return -1;
425425
}
426426
return 0;

0 commit comments

Comments
 (0)