소스 검색

Merge pull request #9333 from sebavan/master

ios video texture from stream
David Catuhe 4 년 전
부모
커밋
2499a5e540
1개의 변경된 파일11개의 추가작업 그리고 0개의 파일을 삭제
  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', '');