Explorar el Código

Merge pull request #9333 from sebavan/master

ios video texture from stream
David Catuhe hace 4 años
padre
commit
2499a5e540
Se han modificado 1 ficheros con 11 adiciones y 0 borrados
  1. 11 0
      src/Materials/Textures/videoTexture.ts

+ 11 - 0
src/Materials/Textures/videoTexture.ts

@@ -373,6 +373,17 @@ export class VideoTexture extends Texture {
      */
     public static CreateFromStreamAsync(scene: Scene, stream: MediaStream): Promise<VideoTexture> {
         var video = document.createElement("video");
+
+        if (scene.getEngine()._badOS) {
+            // Yes... I know and I hope to remove it soon...
+            document.body.appendChild(video);
+            video.style.transform = 'scale(0.0001, 0.0001)';
+            video.style.opacity = '0';
+            video.style.position = 'fixed';
+            video.style.bottom = '0px';
+            video.style.right = '0px';
+        }
+
         video.setAttribute('autoplay', '');
         video.setAttribute('muted', 'true');
         video.setAttribute('playsinline', '');