Make WordPress Core

Opened 36 minutes ago

Last modified 29 minutes ago

#66643 new defect (bug)

Embeds: Vimeo videos ignore the start time (#t=) in the URL

Reported by: karthikeya01 Owned by:
Priority: normal Milestone: Awaiting Review
Component: Embeds Version:
Severity: normal Keywords: has-patch has-unit-tests
Cc: Focuses:

Description

Problem

Vimeo links can start playback at a given time with a URL fragment, for example https://vimeo.com/81400335#t=1m2s (Vimeo's help article on timecode links is cited in the original report below).

When such a link is embedded (Embed/Vimeo block, classic editor, or a bare URL in post content), the video always starts at 0:00.

Steps to reproduce:

  1. Add an Embed block (or a bare URL on its own line) with https://vimeo.com/81400335#t=1m2s.
  2. View the post and play the video.
  3. Playback starts at 0:00 instead of 1:02.

Originally reported in Gutenberg: ​https://github.com/WordPress/gutenberg/issues/25319 (open since 2020, still reproducible).

Cause

The block only stores the URL; the embed HTML comes from WP_oEmbed::fetch(), which sends the full URL (fragment included) as the url argument to https://vimeo.com/api/oembed.json.

Vimeo's oEmbed endpoint ignores any timecode in the url argument. It only honours a separate, documented start_time argument (in seconds):​https://developer.vimeo.com/api/oembed/videos

For comparison, YouTube timecodes already work: YouTube's oEmbed reads t from watch?v=…&t=62 and returns ?start=62.

Proposed fix

Add a default oembed_fetch_url callback, wp_oembed_add_vimeo_start_time(), that:

  • only runs for the core Vimeo provider (https://vimeo.com/api/oembed.{format});
  • reads t from the embedded URL's fragment (62, 62s, 1m2s, 1h2m3s);
  • converts it to seconds (needed, since Vimeo misparses 1m2s) and adds start_time;

Change History (1)

This ticket was mentioned in ​PR #15876 on ​WordPress/wordpress-develop by ​@karthikeya01.


29 minutes ago
#1

  • Keywords has-patch has-unit-tests added

Use of AI Tools

  • Claude Code helped investigate the issue, write the fix and its tests
Note: See TracTickets for help on using tickets.