fix precise-volume position in PiP

This commit is contained in:
Araxeus
2022-04-11 01:07:07 +03:00
parent 30840804fa
commit 0f192aab2b
2 changed files with 17 additions and 11 deletions

View File

@ -33,15 +33,14 @@ const listenForToggle = () => {
const clonedExitButton = originalExitButton.cloneNode(true);
clonedExitButton.onclick = () => togglePictureInPicture();
const player = $('#player');
const onPlayerDblClick = player.onDoubleClick_;
const playerBar = $("ytmusic-player-bar");
const appLayout = $("ytmusic-app-layout");
const expandMenu = $('#expanding-menu');
const middleControls = $('.middle-controls');
const playerPage = $("ytmusic-player-page");
const togglePlayerPageButton = $(".toggle-player-page-button");
const fullScreenButton = $(".fullscreen-button");
const player = $('#player');
const onPlayerDblClick = player.onDoubleClick_;
ipcRenderer.on('pip-toggle', (_, isPip) => {
if (isPip) {
@ -52,13 +51,13 @@ const listenForToggle = () => {
togglePlayerPageButton.click();
}
fullScreenButton.click();
playerBar.classList.add("pip");
appLayout.classList.add("pip");
} else {
$(".exit-fullscreen-button").replaceWith(originalExitButton);
player.onDoubleClick_ = onPlayerDblClick;
expandMenu.onmouseleave = undefined;
originalExitButton.click();
playerBar.classList.remove("pip");
appLayout.classList.remove("pip");
}
});
}