1
0
Fork 0
mirror of https://github.com/HenkKalkwater/harbour-sailfin.git synced 2025-09-05 10:12:46 +00:00

Report playback progress and resume items

[Playback]: New: playback progress is reported to the Jellyfin server.
[Playback]: New: resume partly played items or start playing from the beginning if desired.

I also had to make some changes to the VideoPlayer, because the VideoHUD
got locked up when the player changed status from Buffering to Buffered
too quickly in succession, which occurs when trying to seek directly
after the application is able to.
This commit is contained in:
Chris Josten 2020-10-01 21:45:34 +02:00
parent 7221fda1d5
commit c01fcdcb54
13 changed files with 195 additions and 27 deletions

View file

@ -199,7 +199,7 @@ Page {
+ "/Images/Primary?maxHeight=" + height + "&tag=" + model.imageTags["Primary"]
: ""*/
landscape: !Utils.usePortraitCover(model.type)
progress: model.userData.PlayedPercentage / 100
progress: (typeof model.userData !== "undefined") ? model.userData.PlayedPercentage / 100 : 0.0
onClicked: {
pageStack.push(Utils.getPageUrl(model.mediaType, model.type), {"itemId": model.id})

View file

@ -33,6 +33,7 @@ Page {
property var itemData
property int audioTrack
property int subtitleTrack
property int startTicks: 0
allowedOrientations: Orientation.All
showNavigationIndicator: videoPlayer.hudVisible
@ -45,6 +46,7 @@ Page {
title: itemData.Name
audioTrack: videoPage.audioTrack
subtitleTrack: videoPage.subtitleTrack
startTicks: videoPage.startTicks
onLandscapeChanged: {
console.log("Is landscape: " + landscape)

View file

@ -47,10 +47,14 @@ BaseDetailPage {
PlayToolbar {
imageSource: Utils.itemImageUrl(ApiClient.baseUrl, itemData, "Primary", {"maxWidth": parent.width})
imageAspectRatio: itemData.PrimaryImageAspectRatio
imageAspectRatio: itemData.PrimaryImageAspectRatio || 1.0
playProgress: itemData.UserData.PlayedPercentage / 100
onPlayPressed: pageStack.push(Qt.resolvedUrl("../VideoPage.qml"),
{"itemId": itemId, "itemData": itemData, "audioTrack": trackSelector.audioTrack,
"subtitleTrack": trackSelector.subtitleTrack })
{"itemId": itemId, "itemData": itemData,
"audioTrack": trackSelector.audioTrack,
"subtitleTrack": trackSelector.subtitleTrack,
"startTicks": startFromBeginning ? 0.0
: itemData.UserData.PlaybackPositionTicks })
width: parent.width
}
@ -66,7 +70,7 @@ BaseDetailPage {
PlainLabel {
id: overviewText
text: itemData.Overview
text: itemData.Overview || qsTr("No overview available")
font.pixelSize: Theme.fontSizeSmall
color: Theme.secondaryHighlightColor
}