Browse Source

Video texture from stream ios fix

sebavan 4 năm trước cách đây
mục cha
commit
74872e107a
1 tập tin đã thay đổi với 11 bổ sung0 xóa
  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', '');