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