2020-09-25 12:46:39 +00:00
|
|
|
import QtQuick 2.6
|
|
|
|
import QtMultimedia 5.6
|
|
|
|
import Sailfish.Silica 1.0
|
|
|
|
|
2020-09-25 15:14:44 +00:00
|
|
|
import nl.netsoj.chris.Jellyfin 1.0
|
|
|
|
|
|
|
|
import "../components"
|
|
|
|
|
2020-09-25 12:46:39 +00:00
|
|
|
CoverBackground {
|
|
|
|
readonly property MediaPlayer player: appWindow.mediaPlayer
|
2020-09-25 15:14:44 +00:00
|
|
|
property var mData: appWindow.itemData
|
2020-09-25 12:46:39 +00:00
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
anchors.fill: parent
|
|
|
|
color: "black"
|
|
|
|
|
2020-09-25 13:21:08 +00:00
|
|
|
// Wanted to display the currently running move on here, but it's hard :/
|
2020-09-25 12:46:39 +00:00
|
|
|
/*VideoOutput {
|
|
|
|
id: coverOutput
|
|
|
|
anchors.fill: parent
|
|
|
|
source: player
|
|
|
|
}*/
|
|
|
|
|
|
|
|
}
|
2020-09-25 15:14:44 +00:00
|
|
|
// As a temporary fallback, use the poster image
|
|
|
|
RemoteImage {
|
|
|
|
anchors.fill: parent
|
|
|
|
source: mData.ImageTags["Primary"] ? ApiClient.baseUrl + "/Items/" + mData.Id
|
|
|
|
+ "/Images/Primary?maxHeight=" + height + "&tag=" + mData.ImageTags["Primary"]
|
|
|
|
: ""
|
|
|
|
fillMode: Image.PreserveAspectCrop
|
|
|
|
}
|
2020-09-25 12:46:39 +00:00
|
|
|
|
|
|
|
CoverActionList {
|
|
|
|
CoverAction {
|
|
|
|
id: playPause
|
|
|
|
iconSource: player.playbackState === MediaPlayer.PlayingState ? "image://theme/icon-cover-pause"
|
|
|
|
: "image://theme/icon-cover-play"
|
2020-09-25 15:14:44 +00:00
|
|
|
onTriggered: {
|
|
|
|
if (player.playbackState === MediaPlayer.PlayingState) {
|
|
|
|
player.pause()
|
|
|
|
} else {
|
|
|
|
player.play()
|
|
|
|
}
|
|
|
|
}
|
2020-09-25 12:46:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|