|
228 | 228 | }
|
229 | 229 |
|
230 | 230 | if (pannerType === 'spatial') {
|
231 |
| - sound._panner.positionX.setValueAtTime(pan, Howler.ctx.currentTime); |
232 |
| - sound._panner.positionY.setValueAtTime(0, Howler.ctx.currentTime); |
233 |
| - sound._panner.positionZ.setValueAtTime(0, Howler.ctx.currentTime); |
| 231 | + if (typeof sound._panner.positionX !== 'undefined') { |
| 232 | + sound._panner.positionX.setValueAtTime(pan, Howler.ctx.currentTime); |
| 233 | + sound._panner.positionY.setValueAtTime(0, Howler.ctx.currentTime); |
| 234 | + sound._panner.positionZ.setValueAtTime(0, Howler.ctx.currentTime); |
| 235 | + } else { |
| 236 | + sound._panner.setPosition(pan, 0, 0); |
| 237 | + } |
234 | 238 | } else {
|
235 | 239 | sound._panner.pan.setValueAtTime(pan, Howler.ctx.currentTime);
|
236 | 240 | }
|
|
304 | 308 | setupPanner(sound, 'spatial');
|
305 | 309 | }
|
306 | 310 |
|
307 |
| - sound._panner.positionX.setValueAtTime(x, Howler.ctx.currentTime); |
308 |
| - sound._panner.positionY.setValueAtTime(y, Howler.ctx.currentTime); |
309 |
| - sound._panner.positionZ.setValueAtTime(z, Howler.ctx.currentTime); |
| 311 | + if (typeof sound._panner.positionX !== 'undefined') { |
| 312 | + sound._panner.positionX.setValueAtTime(x, Howler.ctx.currentTime); |
| 313 | + sound._panner.positionY.setValueAtTime(y, Howler.ctx.currentTime); |
| 314 | + sound._panner.positionZ.setValueAtTime(z, Howler.ctx.currentTime); |
| 315 | + } else { |
| 316 | + sound._panner.setOrientation(x, y, z); |
| 317 | + } |
310 | 318 | }
|
311 | 319 |
|
312 | 320 | self._emit('pos', sound._id);
|
|
601 | 609 | sound._panner.refDistance = sound._pannerAttr.refDistance;
|
602 | 610 | sound._panner.rolloffFactor = sound._pannerAttr.rolloffFactor;
|
603 | 611 | sound._panner.panningModel = sound._pannerAttr.panningModel;
|
604 |
| - sound._panner.positionX.setValueAtTime(sound._pos[0], Howler.ctx.currentTime); |
605 |
| - sound._panner.positionY.setValueAtTime(sound._pos[1], Howler.ctx.currentTime); |
606 |
| - sound._panner.positionZ.setValueAtTime(sound._pos[2], Howler.ctx.currentTime); |
607 |
| - sound._panner.orientationX.setValueAtTime(sound._orientation[0], Howler.ctx.currentTime); |
608 |
| - sound._panner.orientationY.setValueAtTime(sound._orientation[1], Howler.ctx.currentTime); |
609 |
| - sound._panner.orientationZ.setValueAtTime(sound._orientation[2], Howler.ctx.currentTime); |
| 612 | + |
| 613 | + if (typeof sound._panner.positionX !== 'undefined') { |
| 614 | + sound._panner.positionX.setValueAtTime(sound._pos[0], Howler.ctx.currentTime); |
| 615 | + sound._panner.positionY.setValueAtTime(sound._pos[1], Howler.ctx.currentTime); |
| 616 | + sound._panner.positionZ.setValueAtTime(sound._pos[2], Howler.ctx.currentTime); |
| 617 | + } else { |
| 618 | + sound._panner.setPosition(sound._pos[0], sound._pos[1], sound._pos[2]); |
| 619 | + } |
| 620 | + |
| 621 | + if (typeof sound._panner.orientationX !== 'undefined') { |
| 622 | + sound._panner.orientationX.setValueAtTime(sound._orientation[0], Howler.ctx.currentTime); |
| 623 | + sound._panner.orientationY.setValueAtTime(sound._orientation[1], Howler.ctx.currentTime); |
| 624 | + sound._panner.orientationZ.setValueAtTime(sound._orientation[2], Howler.ctx.currentTime); |
| 625 | + } else { |
| 626 | + sound._panner.setOrientation(sound._orientation[0], sound._orientation[1], sound._orientation[2]); |
| 627 | + } |
610 | 628 | } else {
|
611 | 629 | sound._panner = Howler.ctx.createStereoPanner();
|
612 | 630 | sound._panner.pan.setValueAtTime(sound._stereo, Howler.ctx.currentTime);
|
|
0 commit comments