mirror of
https://github.com/pvrzz/atmosphere.git
synced 2026-11-29 05:22:26 +00:00
Music videos: keep video and audio, switch between them at the same moment
- Save as Video can also keep a matching audio file (on by default, recommended), copied losslessly from the video where possible - Songs with a video beside them get a video badge; video-only files play as songs - Video button (V) shows the music video in TV mode, kept in sync with the song, so switching between the cover and the video never interrupts playback
This commit is contained in:
@@ -11,6 +11,8 @@ function rangeFill(el) {
|
||||
function updatePlayerBar() {
|
||||
const t = Player.current;
|
||||
$("#player").classList.toggle("idle", !t);
|
||||
$("#videoBtn").hidden = !t?.video;
|
||||
$("#videoBtn").setAttribute("aria-pressed", String(!!(t?.video && Player.showVideo && Lyr.tv)));
|
||||
$("#npArt").replaceChildren(t ? cover(t.art, "np-cover", t.album || t.title) : h("div", { class: "np-cover ph" }, icon("music")));
|
||||
$("#npTitle").textContent = t ? t.title : "Nothing playing";
|
||||
$("#npArtist").replaceChildren(t ? artistLinks(t) : h("span", { class: "muted" }, "Pick something from your library"));
|
||||
@@ -301,9 +303,11 @@ function bindPlayer() {
|
||||
$("#queueBtn").addEventListener("click", () => toggleDrawer("#queuePanel", "#queueBtn", renderQueue));
|
||||
$("#lyricsBtn").addEventListener("click", () => toggleDrawer("#lyricsPanel", "#lyricsBtn", renderLyricsPanel));
|
||||
$("#tvBtn").addEventListener("click", (e) => chooseTvScreen(e.currentTarget));
|
||||
$("#videoBtn").addEventListener("click", toggleVideo);
|
||||
document.addEventListener("click", (e) => { if (e.target.isConnected && !$("#fxPanel").hidden && !e.target.closest("#fxPanel, #fxBtn, .modal-wrap")) closeFx(); });
|
||||
window.addEventListener("player", (e) => {
|
||||
const type = e.detail.type;
|
||||
if (Lyr.tv && type !== "volume" && type !== "fx") syncVideo();
|
||||
if (type === "time") return updateTime();
|
||||
if (type === "volume") return updateVolume();
|
||||
if (type === "fx") return $("#fxBtn").setAttribute("aria-pressed", String(fxActive()));
|
||||
@@ -325,6 +329,7 @@ function bindPlayer() {
|
||||
else if (k.toLowerCase() === "l" && !mod) $("#lyricsBtn").click();
|
||||
else if (k.toLowerCase() === "q" && !mod) $("#queueBtn").click();
|
||||
else if (k.toLowerCase() === "f" && !mod) openTv();
|
||||
else if (k.toLowerCase() === "v" && !mod && Player.current?.video) toggleVideo();
|
||||
});
|
||||
updatePlayerBar();
|
||||
updateTime();
|
||||
|
||||
Reference in New Issue
Block a user