Selaa lähdekoodia

Merge pull request #3675 from DavidHGillen/master

missing cross origin setting
David Catuhe 7 vuotta sitten
vanhempi
commit
d09618f6a1

+ 1 - 1
src/Helpers/babylon.videoDome.ts

@@ -44,7 +44,7 @@ module BABYLON {
          * @param options **loop=true** Automatically loop video on end.
          * @param options **size=1000** Physical radius to create the dome at, defaults to approximately half the far clip plane.
          */
-        constructor(name: string, urlsOrVideo: string[] | HTMLVideoElement, options: {
+        constructor(name: string, urlsOrVideo: string | string[] | HTMLVideoElement, options: {
             resolution?: number,
             clickToPlay?: boolean,
             autoPlay?: boolean,

+ 4 - 1
src/Materials/Textures/babylon.videoTexture.ts

@@ -92,18 +92,21 @@
             if (typeof src === "object") {
                 return src.toString();
             }
-    
+
             return src;
         };
     
         private _getVideo(src: string | string[] | HTMLVideoElement): HTMLVideoElement {
             if (src instanceof HTMLVideoElement) {
+                Tools.SetCorsBehavior(src.currentSrc, src);
                 return src;
             }
             const video: HTMLVideoElement = document.createElement("video");
             if (typeof src === "string") {
+                Tools.SetCorsBehavior(src, video);
                 video.src = src;
             } else {
+                Tools.SetCorsBehavior(src[0], video);
                 src.forEach(url => {
                     const source = document.createElement("source");
                     source.src = url;