File tree Expand file tree Collapse file tree 6 files changed +29
-25
lines changed Expand file tree Collapse file tree 6 files changed +29
-25
lines changed Original file line number Diff line number Diff line change 3737 < script src ="js/libs/stats.min.js "> </ script >
3838 < script src ="js/WebGL.js "> </ script >
3939
40+ < video id ="video " loop muted crossOrigin ="anonymous " webkit-playsinline style ="display:none ">
41+ < source src ="textures/kinect.webm ">
42+ < source src ="textures/kinect.mp4 ">
43+ </ video >
44+
4045 < script id ="vs " type ="x-shader/x-vertex ">
4146
4247 uniform sampler2D map ;
101106 var mouse , center ;
102107 var stats ;
103108
104- var video , texture ;
105-
106109 if ( WEBGL . isWebGLAvailable ( ) ) {
107110
108111 init ( ) ;
134137 center = new THREE . Vector3 ( ) ;
135138 center . z = - 1000 ;
136139
137- video = document . createElement ( 'video' ) ;
140+ var video = document . getElementById ( 'video' ) ;
138141 video . addEventListener ( 'loadedmetadata' , function ( ) {
139142
140- texture = new THREE . VideoTexture ( video ) ;
143+ var texture = new THREE . VideoTexture ( video ) ;
141144 texture . minFilter = THREE . NearestFilter ;
142145
143146 var width = 640 , height = 480 ;
190193
191194
192195 } , false ) ;
193- video . crossOrigin = 'anonymous' ;
194- video . loop = true ;
195- video . muted = true ;
196- video . src = 'textures/kinect.webm' ;
197- video . setAttribute ( 'webkit-playsinline' , 'webkit-playsinline' ) ;
196+
198197 video . play ( ) ;
199198
200199 renderer = new THREE . WebGLRenderer ( ) ;
Original file line number Diff line number Diff line change 3131
3232 < script src ="../build/three.js "> </ script >
3333
34+ < script src ="js/WebGL.js "> </ script >
35+
36+ < video id ="video " loop muted crossOrigin ="anonymous " webkit-playsinline style ="display:none ">
37+ < source src ="textures/pano.webm ">
38+ < source src ="textures/pano.mp4 ">
39+ </ video >
40+
3441 < script >
3542
43+ if ( WEBGL . isWebGLAvailable ( ) === false ) {
44+
45+ document . body . appendChild ( WEBGL . getWebGLErrorMessage ( ) ) ;
46+
47+ }
48+
3649 var camera , scene , renderer ;
3750
3851 var isUserInteracting = false ,
6275 // invert the geometry on the x-axis so that all of the faces point inward
6376 geometry . scale ( - 1 , 1 , 1 ) ;
6477
65- var video = document . createElement ( 'video' ) ;
66- video . crossOrigin = 'anonymous' ;
67- video . width = 640 ;
68- video . height = 360 ;
69- video . loop = true ;
70- video . muted = true ;
71- video . src = 'textures/pano.webm' ;
72- video . setAttribute ( 'webkit-playsinline' , 'webkit-playsinline' ) ;
78+ var video = document . getElementById ( 'video' ) ;
7379 video . play ( ) ;
7480
7581 var texture = new THREE . VideoTexture ( video ) ;
Original file line number Diff line number Diff line change 3434
3535 < script src ="js/vr/WebVR.js "> </ script >
3636
37+ < video id ="video " loop muted crossOrigin ="anonymous " webkit-playsinline style ="display:none ">
38+ < source src ="textures/MaryOculus.webm ">
39+ < source src ="textures/MaryOculus.mp4 ">
40+ </ video >
41+
3742 < script >
3843
3944 var camera , scene , renderer ;
40- var video , texture ;
4145
4246 init ( ) ;
4347 animate ( ) ;
5660
5761 // video
5862
59- video = document . createElement ( 'video' ) ;
60- video . crossOrigin = 'anonymous' ;
61- video . loop = true ;
62- video . muted = true ;
63- video . src = 'textures/MaryOculus.webm' ;
64- video . setAttribute ( 'webkit-playsinline' , 'webkit-playsinline' ) ;
63+ var video = document . getElementById ( 'video' ) ;
6564 video . play ( ) ;
6665
67- texture = new THREE . Texture ( video ) ;
66+ var texture = new THREE . Texture ( video ) ;
6867 texture . generateMipmaps = false ;
6968 texture . minFilter = THREE . NearestFilter ;
7069 texture . maxFilter = THREE . NearestFilter ;
You can’t perform that action at this time.
0 commit comments