Browse Source

Merge pull request #9333 from sebavan/master

ios video texture from stream
David Catuhe 4 years ago
parent
commit
2499a5e540
1 changed files with 11 additions and 0 deletions
  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', '');