Skip to content

Commit

Permalink
Set .playsInline = true on video elements (#443)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mwyrzykowski authored Sep 10, 2024
1 parent a7c8b68 commit 8065282
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions sample/videoUploading/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
1 change: 1 addition & 0 deletions sample/videoUploading/video.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down

0 comments on commit 8065282

Please sign in to comment.