Universal Picture-in-Picture
A Picture-in-Picture (PiP) button that appears on any web video.
Features
- Floating button: Appears in the top-right corner of the video on hover
- Keyboard shortcut:
Alt+P to quickly toggle PiP
- Smart detection: Automatically filters out ads
- Customizable position: Drag and drop the button wherever you want
- Remembered position: Your preferred position is saved between sessions
- YouTube compatible: Works on YouTube and all other video sites
- Auto-hide: Button disappears after 3 seconds
Usage
Floating button
- Hover over a video with your mouse
- A PiP button appears in the top-right corner
- Click it to activate Picture-in-Picture mode
Keyboard shortcut
- Press
Alt+P anytime to toggle PiP on the best detected video
Customize position
- Move: Click and drag the button to your preferred position
- Reset: Right-click the button to return to default position
Compatibility
Tested and working on:
- YouTube
- Twitch
- Vimeo
- Netflix
- And most sites with HTML5 video players
Technical notes
- The script uses native DOM methods (no
innerHTML) to be compatible with YouTube's Trusted Types security policy
- Button position is stored as a percentage to adapt to different video sizes
- Videos that are too small (< 100px) or identified as ads are automatically ignored