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:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user