Explorar o código

Add poster to videoDome

Sebastien Vandenberghe %!s(int64=7) %!d(string=hai) anos
pai
achega
7f71f81b87
Modificáronse 1 ficheiros con 3 adicións e 2 borrados
  1. 3 2
      src/Helpers/babylon.videoDome.ts

+ 3 - 2
src/Helpers/babylon.videoDome.ts

@@ -51,7 +51,8 @@ module BABYLON {
             clickToPlay?: boolean,
             clickToPlay?: boolean,
             autoPlay?: boolean,
             autoPlay?: boolean,
             loop?: boolean,
             loop?: boolean,
-            size?: number
+            size?: number,
+            poster?: string
         }, scene: Scene) {
         }, scene: Scene) {
             super(name, scene);
             super(name, scene);
 
 
@@ -64,7 +65,7 @@ module BABYLON {
             options.size = Math.abs(options.size as any) || (scene.activeCamera ? scene.activeCamera.maxZ * 0.48 : 1000);
             options.size = Math.abs(options.size as any) || (scene.activeCamera ? scene.activeCamera.maxZ * 0.48 : 1000);
 
 
             // create
             // create
-            let tempOptions: VideoTextureSettings = { loop: options.loop, autoPlay: options.autoPlay, autoUpdateTexture: true };
+            let tempOptions: VideoTextureSettings = { loop: options.loop, autoPlay: options.autoPlay, autoUpdateTexture: true, poster: options.poster };
             let material = this._material = new BackgroundMaterial(name + "_material", scene);
             let material = this._material = new BackgroundMaterial(name + "_material", scene);
             let texture = this._videoTexture = new VideoTexture(name + "_texture", urlsOrVideo, scene, false, false, Texture.TRILINEAR_SAMPLINGMODE, tempOptions);
             let texture = this._videoTexture = new VideoTexture(name + "_texture", urlsOrVideo, scene, false, false, Texture.TRILINEAR_SAMPLINGMODE, tempOptions);
             this._mesh = MeshBuilder.CreateIcoSphere(name + "_mesh", {
             this._mesh = MeshBuilder.CreateIcoSphere(name + "_mesh", {