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

Move playback logic to C++ side

This commit is contained in:
Chris Josten 2021-02-14 00:21:49 +01:00
parent 5ddd5e8e2e
commit a244c27b1a
8 changed files with 147 additions and 84 deletions

View file

@ -21,6 +21,8 @@ import Sailfish.Silica 1.0
import "../components"
import nl.netsoj.chris.Jellyfin 1.0
/**
* Page only containing a video player.
*
@ -29,11 +31,10 @@ import "../components"
Page {
id: videoPage
property string itemId
property var itemData
property JellyfinItem itemData
property int audioTrack
property int subtitleTrack
property real startTicks: 0 // Why is this a real? Because an integer only goes to 3:44 when the ticks are converted to doubles
property bool resume: true
allowedOrientations: Orientation.All
showNavigationIndicator: videoPlayer.hudVisible
@ -41,12 +42,12 @@ Page {
VideoPlayer {
id: videoPlayer
anchors.fill: parent
itemId: videoPage.itemId
player: appWindow.mediaPlayer
title: itemData.name
audioTrack: videoPage.audioTrack
subtitleTrack: videoPage.subtitleTrack
startTicks: videoPage.startTicks
resume: videoPage.resume
item: itemData
onLandscapeChanged: {
console.log("Is landscape: " + landscape)

View file

@ -62,7 +62,7 @@ Page {
id: backdropBackground
ThemeBackground {
sourceItem: backdrop
backgroundMaterial: Materials.blur
backgroundMaterial: "blur"
}
}

View file

@ -60,11 +60,10 @@ BaseDetailPage {
favourited: itemData.userData.isFavorite
playProgress: itemData.userData.playedPercentage / 100
onPlayPressed: pageStack.push(Qt.resolvedUrl("../VideoPage.qml"),
{"itemId": itemId, "itemData": itemData,
{"itemData": itemData,
"audioTrack": trackSelector.audioTrack,
"subtitleTrack": trackSelector.subtitleTrack,
"startTicks": startFromBeginning ? 0.0
: _playbackProsition })
"resume": resume})
}
VideoTrackSelector {