Skip to content

Auto-expand card when video play clicked in collapsed state #34

Description

@khurchla

From #33 review feedback. User asked: 'If user clicks play while in collapsed state, could it also auto-expand to the expanded state when it starts playing?' Acknowledged 'acceptable as is' if hard.

Why deferred: Cross-origin iframes (YouTube, Vimeo) don't surface play events to the parent document. Detecting a play click on the embedded player requires:

  1. YouTube IFrame Player API — append ?enablejsapi=1 to embed URL, load YouTube's iframe_api JS, instantiate a YT.Player on the iframe element, listen to onStateChange events for state === YT.PlayerState.PLAYING.
  2. Vimeo Player JS API — load player.js library, instantiate a Vimeo Player on the iframe, listen to 'play' event.

Both require runtime JS overhead (the YouTube/Vimeo libraries) and a per-provider dispatch. Worth doing if it becomes a recurring usability gap; not blocking launch.

When triggered: card auto-expands (set isExpanded = true). Already-rendered iframe continues playing through the expansion (or restarts with autoplay=1 in expanded src).

Trigger to revisit: post-launch, if user testing surfaces a real friction point at the play-in-collapsed step.

Metadata

Metadata

Assignees

No one assigned

    Labels

    futurePost-launch / unscheduledphase-7D3 visualizations + sv-animations

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions