Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hong-tm/auto-picture-in-picture
This script enhances your video-watching experience by automatically enabling PiP, allowing efficient multitasking while watching videos. Feel free to reach out if you encounter any issues or need adjustments!
https://github.com/hong-tm/auto-picture-in-picture
bilibili chrome greasyfork picture-in-picture pip youtube
Last synced: about 1 month ago
JSON representation
This script enhances your video-watching experience by automatically enabling PiP, allowing efficient multitasking while watching videos. Feel free to reach out if you encounter any issues or need adjustments!
- Host: GitHub
- URL: https://github.com/hong-tm/auto-picture-in-picture
- Owner: hong-tm
- License: mit
- Created: 2024-11-10T21:23:01.000Z (about 2 months ago)
- Default Branch: main
- Last Pushed: 2024-11-10T22:23:41.000Z (about 2 months ago)
- Last Synced: 2024-11-10T22:25:02.866Z (about 2 months ago)
- Topics: bilibili, chrome, greasyfork, picture-in-picture, pip, youtube
- Language: JavaScript
- Homepage: https://greasyfork.org/zh-CN/scripts/516762-auto-picture-in-picture
- Size: 11.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# π YouTube and Bilibili Auto Picture-in-Picture (PiP) Userscript
> **Currently Only Compatible with Chrome and Brave! Edge is Not Supported**
This userscript automatically triggers Picture-in-Picture (PiP) mode while watching YouTube and Bilibili videos. It handles tab switching and playback status changes, providing a smooth video-watching experience. Inspired by the Arc browser experience, it was developed with AI assistance. Future maintenance may be sporadic.
π **Enjoy the smoothest PiP experience!**
![GIF Preview](https://github.com/user-attachments/assets/2a61bb9e-03a9-418f-8db6-073c98e2fcd9)
---
## π» Installation
- [Install on GreasyFork](https://greasyfork.org/zh-CN/scripts/516762-auto-picture-in-picture)## β Support the Author
- [aifadian](https://afdian.com/a/h1789)---
## π Key Features
### 1. Automatic PiP Mode Activation
- π PiP mode is automatically triggered during video playback, allowing you to view the video in a floating window while multitasking or browsing other pages.
- β‘ If you switch tabs, PiP mode will wait for user interaction to activate.### 2. Prevents PiP Trigger on Pause
- β When the pause button is clicked, PiP mode will not be triggered, preventing accidental PiP entry.### 3. Tab Switching Handling
- π When you return to the video tab, PiP remains in standby and activates only when the video is clicked.### 4. Video Click Event
- π¬ PiP mode is triggered when the video is clicked, as long as itβs playing.### 5. Supports Media Session API (Chrome 120+)
- π± Uses `navigator.mediaSession` API to set "Enter PiP" action, enabling control of PiP via media sessions.### 6. Bypasses User Interaction Requirement
- β Unlike other scripts, this one activates PiP without requiring page interaction.---
## βοΈ Setup Instructions for Chrome
To ensure the script works correctly, follow these steps:
1. **Open Chrome Settings**
- Click the "three dots" icon in the upper-right corner and select "Settings".2. **Access Site Settings**
- Go to "Privacy and Security" β "Site Settings".3. **Enable Auto PiP Mode**
- Under "Permissions," select "Additional Permissions Settings".
- Locate "Automatically enter Picture-in-Picture mode" and allow sites to use this feature automatically.4. **Enable Developer Mode for Extensions**
5. **Enable Chrome Flags**
- Go to `chrome://flags` and enable:
- `Auto picture in picture video heuristics`
- `Auto picture in picture for video playback`---
![Chrome Settings](https://github.com/user-attachments/assets/a368329b-3363-443f-8f6a-c85e9abccd95)
![Extension Flags](https://github.com/user-attachments/assets/0a4740d9-088a-4f07-a702-6baa55f66dc6)