mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-13 03:11:46 +00:00
46 lines
1.0 KiB
TypeScript
46 lines
1.0 KiB
TypeScript
import style from './style.css?inline';
|
|
import { createPlugin } from '@/utils';
|
|
|
|
import { onConfigChange, onMainLoad } from './main';
|
|
import { onMenu } from './menu';
|
|
import { onPlayerApiReady, onRendererLoad } from './renderer';
|
|
|
|
export type PictureInPicturePluginConfig = {
|
|
'enabled': boolean;
|
|
'alwaysOnTop': boolean;
|
|
'savePosition': boolean;
|
|
'saveSize': boolean;
|
|
'hotkey': 'P',
|
|
'pip-position': [number, number];
|
|
'pip-size': [number, number];
|
|
'isInPiP': boolean;
|
|
'useNativePiP': boolean;
|
|
}
|
|
|
|
export default createPlugin({
|
|
name: 'Picture In Picture',
|
|
restartNeeded: true,
|
|
config: {
|
|
'enabled': false,
|
|
'alwaysOnTop': true,
|
|
'savePosition': true,
|
|
'saveSize': false,
|
|
'hotkey': 'P',
|
|
'pip-position': [10, 10],
|
|
'pip-size': [450, 275],
|
|
'isInPiP': false,
|
|
'useNativePiP': true,
|
|
} as PictureInPicturePluginConfig,
|
|
stylesheets: [style],
|
|
menu: onMenu,
|
|
|
|
backend: {
|
|
start: onMainLoad,
|
|
onConfigChange,
|
|
},
|
|
renderer: {
|
|
start: onRendererLoad,
|
|
onPlayerApiReady,
|
|
}
|
|
});
|