Skip to content

Commit fb2320a

Browse files
committed
feat: Allow three.js renderer options to be configurable (videojs#259)
2 parents 96f2413 + 2470e36 commit fb2320a

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

src/plugin.js

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,14 @@ const defaults = {
2323
omnitoneOptions: {},
2424
projection: 'AUTO',
2525
sphereDetail: 32,
26-
disableTogglePlay: false
26+
disableTogglePlay: false,
27+
threeRendererOptions:{
28+
devicePixelRatio: window.devicePixelRatio,
29+
alpha: false,
30+
clearColor: 0xffffff,
31+
antialias: true,
32+
powerPreference: 'high-performance'
33+
},
2734
};
2835

2936
const errors = {
@@ -655,13 +662,10 @@ void main() {
655662
}
656663

657664
this.camera.position.set(0, 0, 0);
658-
this.renderer = new THREE.WebGLRenderer({
659-
devicePixelRatio: window.devicePixelRatio,
660-
alpha: false,
661-
clearColor: 0xffffff,
662-
antialias: true,
663-
powerPreference: 'high-performance'
664-
});
665+
666+
const rendererOptions =this.options_.threeRendererOptions;
667+
668+
this.renderer = new THREE.WebGLRenderer(rendererOptions);
665669

666670
const webglContext = this.renderer.getContext('webgl');
667671
const oldTexImage2D = webglContext.texImage2D;

0 commit comments

Comments
 (0)