Browse Source

Merge pull request #13470 from mrdoob/videotexture-test

Test manually updating video texture in webvr_video
Mr.doob 7 years ago
parent
commit
d4d51ce6ec
1 changed files with 12 additions and 1 deletions
  1. 12 1
      examples/webvr_video.html

+ 12 - 1
examples/webvr_video.html

@@ -65,11 +65,22 @@
 				video.setAttribute( 'webkit-playsinline', 'webkit-playsinline' );
 				video.play();
 
-				texture = new THREE.VideoTexture( video );
+				texture = new THREE.Texture( video );
+				texture.generateMipmaps = false;
 				texture.minFilter = THREE.NearestFilter;
 				texture.maxFilter = THREE.NearestFilter;
 				texture.format = THREE.RGBFormat;
 
+				setInterval( function () {
+
+					if ( video.readyState >= video.HAVE_CURRENT_DATA ) {
+
+						texture.needsUpdate = true;
+
+					}
+
+				}, 1000 / 24 );
+
 				scene = new THREE.Scene();
 				scene.background = new THREE.Color( 0x101010 );