Fix audio on iOS
parent
bbb61394f4
commit
a773b60b95
|
@ -36,6 +36,11 @@ window.nitroAudio = new (function() {
|
|||
|
||||
function updateListener(pos, view) {
|
||||
var listener = ctx.listener;
|
||||
if (listener.positionX == null) {
|
||||
//use old setters. safari ios
|
||||
listener.setPosition(pos[0], pos[1], pos[2]);
|
||||
listener.setOrientation(view[8], -view[9], -view[10], view[4], view[5], view[6]);
|
||||
} else {
|
||||
listener.positionX.value = pos[0];
|
||||
listener.positionY.value = pos[1];
|
||||
listener.positionZ.value = pos[2];
|
||||
|
@ -46,6 +51,7 @@ window.nitroAudio = new (function() {
|
|||
listener.upY.value = view[5];
|
||||
listener.upZ.value = view[6];
|
||||
}
|
||||
}
|
||||
|
||||
function tick() {
|
||||
for (var i=0; i<t.sounds.length; i++) {
|
||||
|
|
Loading…
Reference in New Issue