mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-16 17:46:17 -08:00
22 lines
549 B
JavaScript
22 lines
549 B
JavaScript
import { append, tooltip } from '../utils';
|
|
|
|
export default function pip(option) {
|
|
return (art) => ({
|
|
...option,
|
|
tooltip: art.i18n.get('PIP Mode'),
|
|
mounted: ($control) => {
|
|
const { proxy, icons, i18n } = art;
|
|
|
|
append($control, icons.pip);
|
|
|
|
proxy($control, 'click', () => {
|
|
art.pip = !art.pip;
|
|
});
|
|
|
|
art.on('pip', (value) => {
|
|
tooltip($control, i18n.get(value ? 'Exit PIP Mode' : 'PIP Mode'));
|
|
});
|
|
},
|
|
});
|
|
}
|