HTML5 audio context fix

This commit is contained in:
Joshua Granick
2018-08-08 21:11:35 -07:00
parent 4f6c0c6e3b
commit e93c2fa4ae
2 changed files with 5 additions and 6 deletions

View File

@@ -42,7 +42,7 @@ class AudioContext {
try {
untyped __js__ ("window.AudioContext = window.AudioContext || window.webkitAudioContext;");
web = cast untyped __js__ ("new AudioContext ()");
web = cast untyped __js__ ("new window.AudioContext ()");
this.type = WEB;
} catch (e:Dynamic) {}

View File

@@ -32,7 +32,8 @@ class AudioManager {
if (context == null) {
context = new AudioContext ();
AudioManager.context = new AudioContext ();
context = AudioManager.context;
#if !lime_doc_gen
if (context.type == OPENAL) {
@@ -47,12 +48,10 @@ class AudioManager {
}
#end
} else {
AudioManager.context = context;
}
AudioManager.context = context;
#if (lime_cffi && !macro && lime_openal && (ios || tvos || mac))
var timer = new Timer (100);
timer.run = function () {