Limeplay - Open Source Video Player UI ComponentsLimeplay

Picture-in-Picture Control

Toggle Picture-in-Picture mode for video playback.

Installation

npx shadcn add @limeplay/picture-in-picture-control

Requires pictureInPictureFeature registered in your createMediaKit.

Usage

components/player/pip-button.tsx
import { PictureInPictureIcon } from "@phosphor-icons/react"

import { Button } from "@/components/ui/button"
import { usePictureInPictureStore } from "@/hooks/limeplay/use-picture-in-picture"
import { PictureInPictureControl } from "@/components/limeplay/picture-in-picture-control"

export function PipButton() {
  const active = usePictureInPictureStore(s => s.active)

  return (
    <PictureInPictureControl asChild shortcut="P">
      <Button variant="ghost" size="icon">
        <PictureInPictureIcon
          weight={active ? "fill" : "regular"}
          size={18}
        />
      </Button>
    </PictureInPictureControl>
  )
}

Supports asChild for custom button rendering. The component auto-detects browser support and disables itself when PiP is unavailable.

Browser Support

PiP API is not natively supported in Firefox. Reference

API Reference

Prop

Type

On this page