1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-05-02 02:22:06 -04:00

osd(media): workaround for firefox reporting youtube thumbnails as

players
fixes #2298
This commit is contained in:
bbedward
2026-04-28 11:27:16 -04:00
parent 7c9e805cbe
commit 85c2954958
3 changed files with 60 additions and 13 deletions

View File

@@ -10,4 +10,14 @@ Singleton {
readonly property list<MprisPlayer> availablePlayers: Mpris.players.values
property MprisPlayer activePlayer: availablePlayers.find(p => p.isPlaying) ?? availablePlayers.find(p => p.canControl && p.canPlay) ?? null
function isFirefoxYoutubeHoverPreview(player: MprisPlayer): bool {
if (!player)
return false;
const id = (player.identity || "").toLowerCase();
if (!id.includes("firefox"))
return false;
const url = (player.metadata?.["xesam:url"] || "").toString();
return /^https?:\/\/(www\.)?youtube\.com\/?($|\?|#)/i.test(url);
}
}