1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2025-12-07 05:55:37 -05:00

Many bug fixes for media center, spotlight

This commit is contained in:
bbedward
2025-07-12 10:47:01 -04:00
parent 2375b6e7bd
commit af0522ada5
13 changed files with 180 additions and 329 deletions

View File

@@ -136,4 +136,24 @@ Singleton {
this.trackedPlayer = targetPlayer
}
// Seeking support
property bool canSeek: this.activePlayer?.canSeek ?? false
property real position: this.activePlayer?.position ?? 0
property real length: this.activePlayer?.length ?? 0
function seek(offsetUs) {
if (this.canSeek && this.activePlayer) {
this.activePlayer.seek(offsetUs)
}
}
function setPosition(trackId, positionUs) {
if (this.canSeek && this.activePlayer && typeof this.activePlayer.setPosition === "function") {
this.activePlayer.setPosition(trackId, positionUs)
} else if (this.canSeek && this.activePlayer) {
// Fallback to setting position property
this.activePlayer.position = positionUs
}
}
}