From 80652829ac4f5ba29a1758f4212cac041e1664f2 Mon Sep 17 00:00:00 2001 From: mwyrzykowski <105083895+mwyrzykowski@users.noreply.github.com> Date: Tue, 10 Sep 2024 11:17:37 -0700 Subject: [PATCH] Set .playsInline = true on video elements (#443) Some mobile browsers require playsInline to be set to true for the video to play with the rest of the content. To avoid WebGPU samples testing differences between mobile and desktop browsers, set playsInline = true prior to playing the video. --- sample/videoUploading/main.ts | 1 + sample/videoUploading/video.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/sample/videoUploading/main.ts b/sample/videoUploading/main.ts index 93d5ddb8..91cda303 100644 --- a/sample/videoUploading/main.ts +++ b/sample/videoUploading/main.ts @@ -10,6 +10,7 @@ quitIfWebGPUNotAvailable(adapter, device); // Set video element const video = document.createElement('video'); video.loop = true; +video.playsInline = true; video.autoplay = true; video.muted = true; video.src = '../../assets/video/pano.webm'; diff --git a/sample/videoUploading/video.ts b/sample/videoUploading/video.ts index 22481556..fadde5d9 100644 --- a/sample/videoUploading/video.ts +++ b/sample/videoUploading/video.ts @@ -7,6 +7,7 @@ export default async function ({ useVideoFrame }: { useVideoFrame: boolean }) { // Set video element const video = document.createElement('video'); video.loop = true; + video.playsInline = true; video.autoplay = true; video.muted = true; video.src = '../../assets/video/pano.webm';