AddThisFeature

Picture-in-Picture Mode

Let viewers pop a video into a floating window and keep using the rest of the app.

simple Media & Video

What it adds

A control on the video player that hands the video to the browser's floating always-on-top window.

What your agent is told to do

5
  1. 1

    Add the control to the app's existing video player rather than building a separate popped-out player. Two players competing over the same element is the main way this feature goes wrong.

  2. 2

    Keep the app in sync with the floating window in both directions. Pausing, seeking, or changing volume from the floating window must update the in-page player, and closing the floating window must return playback to the page at the same position.

  3. 3

    Decide explicitly what happens when the user navigates away from the page that owns the video. Either keep the floating window alive and reconnect when they return, or end it cleanly, but do not leave a floating window playing a video the app has forgotten about.

  4. 4

    Feature-detect and hide the control entirely where the browser does not support it. A visible button that does nothing is worse than no button.

  5. 5

    Do not fight a sticky or mini player if the app already has one. When the video enters the floating window, collapse the sticky player rather than running both.

Edge cases it handles

8
  • Where the browser has no picture-in-picture support, or the site is inside a frame that forbids it, the control must be absent rather than present and inert.
  • The viewer can pause, seek, or skip from the floating window's own controls, which the page never sees unless you listen for it. Without that listening the in-page transport shows the wrong state the moment they use it.
  • If the video element unmounts while the floating window is open, decide the behaviour before the framework decides it for you. Detaching the element usually kills playback silently mid-sentence.
  • A sticky mini player and a floating window both claiming the same video will flip between each other. Make entering one the exit condition for the other.
  • When the floating window closes, restore focus to the control that opened it and leave the page scrolled where the viewer was, not jumped back to the player.
  • Some browsers require a user gesture to enter this mode. Entering it from a timer or on page load will be refused, and that refusal must not surface as an error.
  • Only one floating window can exist at a time. Starting a second video must take over the window rather than fail quietly.
  • The control needs a label that says which state it will move to, and it must be reachable by keyboard like the rest of the transport.

Definition of done

9
  • The floating-window control appears only where the browser supports it.
  • Playback state, position, and volume stay in sync in both directions.
  • Closing the floating window returns playback to the page at the correct position.
  • The video element unmounting mid-playback has a defined, non-silent behaviour.
  • The app's sticky or mini player yields rather than competing for the same video.
  • Focus and scroll position are restored when the floating window closes.
  • The control is keyboard reachable and clearly labelled.
  • The feature matches the existing design system.
  • No existing functionality is broken.

Related features

How it works

  1. 1

    Copy the link

    Grab the Markdown instruction URL for this feature.

  2. 2

    Give it to your AI

    Paste it into Claude Code, Cursor, v0, Lovable — whatever you build with.

  3. 3

    It inspects, then implements

    Your agent reads your existing app first, then adds the feature to fit it.

Works with your stack

These instructions are written to adapt. They tell the agent to detect your framework, match your existing design system, and reuse what you already have — rather than assuming a particular stack.

Need it tighter than that? Customize the feature and tell it exactly what you're running.