瀏覽代碼

Merge pull request #15353 from Mugen87/dev19

Example: Fix webaudio_orientation for Chrome mobile
Mr.doob 6 年之前
父節點
當前提交
b3d459f2f3
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      examples/webaudio_orientation.html

+ 1 - 1
examples/webaudio_orientation.html

@@ -158,6 +158,7 @@
 		camera.add( listener );
 		camera.add( listener );
 
 
 		var audioElement = document.getElementById( 'music' );
 		var audioElement = document.getElementById( 'music' );
+		audioElement.play();
 
 
 		var positionalAudio = new THREE.PositionalAudio( listener );
 		var positionalAudio = new THREE.PositionalAudio( listener );
 		positionalAudio.setMediaElementSource( audioElement );
 		positionalAudio.setMediaElementSource( audioElement );
@@ -184,7 +185,6 @@
 
 
 			} );
 			} );
 
 
-			audioElement.play();
 			boomBox.add( positionalAudio );
 			boomBox.add( positionalAudio );
 			scene.add( boomBox );
 			scene.add( boomBox );
 			animate();
 			animate();