summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/.DS_Storebin6148 -> 6148 bytes
-rw-r--r--app/index.php48
-rw-r--r--app/ui/lyrics.php2
3 files changed, 46 insertions, 4 deletions
diff --git a/app/.DS_Store b/app/.DS_Store
index 7889376..1ab3b24 100644
--- a/app/.DS_Store
+++ b/app/.DS_Store
Binary files differ
diff --git a/app/index.php b/app/index.php
index 601c974..6de3cdf 100644
--- a/app/index.php
+++ b/app/index.php
@@ -1,6 +1,21 @@
<?php
header("X-Frame-Options: DENY");
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $_PROFILE; ?>
+<!--
+
+🏳️‍⚧️🏳️‍⚧️🏳️‍⚧️🏳️‍⚧️🏳️‍⚧️🏳️‍⚧️🏳️‍⚧️🏳️‍⚧️🏳️‍⚧️🏳️‍⚧️🏳️‍⚧️🏳️‍⚧️🏳️‍⚧️🏳️‍⚧️🏳️‍⚧️🏳️‍⚧️🏳️‍⚧️🏳️‍⚧️🏳️‍⚧️🏳️‍⚧️🏳️‍⚧️🏳️‍⚧️🏳️‍⚧️🏳️‍⚧️🏳️‍⚧️🏳️‍⚧️🏳️‍⚧️🏳️‍⚧️🏳️‍⚧️🏳️‍⚧️🏳️‍⚧️🏳️‍⚧️🏳️‍⚧️🏳️‍⚧️🏳️‍⚧️🏳️‍⚧️🏳️‍⚧️
+
+ __ _ __ __ __
+ / /__________ _____ _____ _____(_)___ _/ /_ / /______/ /
+ / __/ ___/ __ `/ __ \/ ___/ / ___/ / __ `/ __ \/ __/ ___/ /
+/ /_/ / / /_/ / / / (__ ) / / / / /_/ / / / / /_(__ )_/
+\__/_/ \__,_/_/ /_/____/ /_/ /_/\__, /_/ /_/\__/____(_)
+ /____/
+
+🏳️‍⚧️🏳️‍⚧️🏳️‍⚧️🏳️‍⚧️🏳️‍⚧️🏳️‍⚧️🏳️‍⚧️🏳️‍⚧️🏳️‍⚧️🏳️‍⚧️🏳️‍⚧️🏳️‍⚧️🏳️‍⚧️🏳️‍⚧️🏳️‍⚧️🏳️‍⚧️🏳️‍⚧️🏳️‍⚧️🏳️‍⚧️🏳️‍⚧️🏳️‍⚧️🏳️‍⚧️🏳️‍⚧️🏳️‍⚧️🏳️‍⚧️🏳️‍⚧️🏳️‍⚧️🏳️‍⚧️🏳️‍⚧️🏳️‍⚧️🏳️‍⚧️🏳️‍⚧️🏳️‍⚧️🏳️‍⚧️🏳️‍⚧️🏳️‍⚧️🏳️‍⚧️
+
+-->
+
<!doctype html>
<html lang="en">
<head>
@@ -271,6 +286,7 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $_PROFI
window.seekTo = (time) => {
document.getElementById("player").contentDocument.getElementById("player-audio").currentTime = time;
+ updateAndroidNotification();
if (playingStella) {
playerDocument.getElementById("player-audio-stella-side1").currentTime = playerDocument.getElementById("player-audio").currentTime;
@@ -422,10 +438,16 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $_PROFI
}
playerDocument.getElementById("player-audio").onplay = () => {
+ updateAndroidNotification();
+
if (window.preloadedGains[window.currentSongID]) {
window.currentNormalizationSource.connect(window.preloadedGains[window.currentSongID]);
- window.currentNormalizationSource2.connect(window.preloadedGainsBoosted1[window.currentSongID]);
- window.currentNormalizationSource3.connect(window.preloadedGainsBoosted2[window.currentSongID]);
+
+ if (playingStella) {
+ window.currentNormalizationSource2.connect(window.preloadedGainsBoosted1[window.currentSongID]);
+ window.currentNormalizationSource3.connect(window.preloadedGainsBoosted2[window.currentSongID]);
+ }
+
window.preloadedGains[window.currentSongID].connect(window.currentNormalizationContext.destination);
}
@@ -447,10 +469,25 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $_PROFI
updateDisplay();
}
+ window.needsDurationChange = true;
+
+ playerDocument.getElementById("player-audio").ondurationchange = () => {
+ if (window.needsDurationChange) {
+ updateAndroidNotification();
+ window.needsDurationChange = false;
+ }
+ }
+
playerDocument.getElementById("player-audio").onpause = () => {
if (window.preloadedGains[window.currentSongID]) {
try {
window.currentNormalizationSource.disconnect(window.preloadedGains[window.currentSongID]);
+
+ if (playingStella) {
+ window.currentNormalizationSource2.disconnect(window.preloadedGainsBoosted1[window.currentSongID]);
+ window.currentNormalizationSource3.disconnect(window.preloadedGainsBoosted2[window.currentSongID]);
+ }
+
window.preloadedGains[window.currentSongID].disconnect(window.currentNormalizationContext.destination);
} catch (e) {
console.error(e);
@@ -486,16 +523,19 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $_PROFI
}
updateDisplay();
+ updateAndroidNotification();
}
}
initializePlayerDocument();
- function updateDisplay() {
+ function updateAndroidNotification() {
if (window.MistAndroid && currentSong) {
window.MistAndroid.setNotificationData(currentSong.title, currentSong.artist, currentSong.album, Math.round(playerDocument.getElementById("player-audio").currentTime * 1000), Math.round(playerDocument.getElementById("player-audio").duration * 1000), !playerDocument.getElementById("player-audio").paused, buffering);
}
+ }
+ function updateDisplay() {
if (playerDocument.getElementById("player-audio").paused) {
document.title = "Mist";
} else if (currentSong) {
@@ -853,6 +893,7 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $_PROFI
window.currentSong = songs[id];
window.currentSongID = id;
updateDisplay();
+ updateAndroidNotification();
if (document.getElementById("ui").contentWindow.refreshQueue) document.getElementById("ui").contentWindow.refreshQueue();
let stellaCompatible = false;
@@ -886,6 +927,7 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $_PROFI
cleanupPreload();
preloadMore();
+ window.needsDurationChange = true;
if (!stellaCompatible) {
if (!window.preloadedURLs[id]) {
diff --git a/app/ui/lyrics.php b/app/ui/lyrics.php
index 8f50931..274ff93 100644
--- a/app/ui/lyrics.php
+++ b/app/ui/lyrics.php
@@ -43,7 +43,7 @@
}
</style>
</head>
-<body class="crossplatform" style="background-color: transparent;">
+<body style="background-color: transparent;">
<script src="/assets/js/common.js"></script>
<div id="lyrics-outer">
<div id="not-playing" style="position: fixed; inset: 16px; display: flex; align-items: center; justify-content: center; opacity: .5; text-align: center;">