Skip to content

Conversation

Infinite-Null
Copy link
Contributor

@Infinite-Null Infinite-Null commented Jun 3, 2025

Closes: #51995

What?

Fixes blank first frame issue in video blocks on iOS Safari by adding video.load() call in Script Module.

Why?

iOS Safari has a rendering timing issue where video elements show a blank/black frame before displaying the actual first frame of the video.

How?

  • Adds a new Script Module (video/view.js) that targets iOS devices specifically
  • Calls video.load() method to force the browser to reload and properly render the first frame
  • Implements safeguards to prevent multiple executions on the same video element

Testing Instructions

  1. Open iOS Simulator or use an actual iOS device
  2. Create a new post or page in WordPress
  3. Insert a Video block
  4. Upload or select a video file
  5. Publish/preview the page
  6. Navigate to the published page on iOS Safari
  7. Observe that the video displays the first frame immediately without showing a blank/black frame

Screencast

Before

Screen.Recording.2025-06-04.at.2.03.02.PM.mov

After

Screen.Recording.2025-06-04.at.1.55.51.PM.mov

@Infinite-Null Infinite-Null marked this pull request as ready for review June 4, 2025 08:43
Copy link

github-actions bot commented Jun 4, 2025

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Unlinked Accounts

The following contributors have not linked their GitHub and WordPress.org accounts: @porg.

Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Unlinked contributors: porg.

Co-authored-by: Infinite-Null <[email protected]>
Co-authored-by: fluiddot <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@t-hamano t-hamano added [Type] Bug An existing feature does not function as intended [Block] Video Affects the Video Block OS Issues Issues or PRs that are related to OS specific problems labels Jun 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Video Affects the Video Block OS Issues Issues or PRs that are related to OS specific problems [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Video Block: First frame not shown as the poster on iOS Safari — Fix: Use Fragment URL
2 participants