mirror of
https://github.com/HenkKalkwater/harbour-sailfin.git
synced 2025-09-05 10:12:46 +00:00
Added videoplayer and many unrelated things
This commit is contained in:
parent
53b3eac213
commit
92a18c4fa5
28 changed files with 889 additions and 51 deletions
|
@ -4,6 +4,7 @@ import Sailfish.Silica 1.0
|
|||
import nl.netsoj.chris.Jellyfin 1.0
|
||||
|
||||
import "../components"
|
||||
import "../compontents/details"
|
||||
|
||||
Page {
|
||||
id: pageRoot
|
||||
|
@ -102,6 +103,7 @@ Page {
|
|||
IconButton {
|
||||
id: playButton
|
||||
icon.source: "image://theme/icon-l-play"
|
||||
onPressed: pageStack.push(Qt.resolvedUrl("VideoPage.qml"), {"itemId": itemId, "itemData": itemData})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -122,6 +124,7 @@ Page {
|
|||
onStatusChanged: {
|
||||
if (status == PageStatus.Deactivating) {
|
||||
backdrop.clear()
|
||||
appWindow.itemData = ({})
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -129,9 +132,10 @@ Page {
|
|||
target: ApiClient
|
||||
onItemFetched: {
|
||||
if (itemId === pageRoot.itemId) {
|
||||
console.log(JSON.stringify(result))
|
||||
//console.log(JSON.stringify(result))
|
||||
pageRoot.itemData = result
|
||||
pageRoot._loading = false
|
||||
appWindow.itemData = result
|
||||
}
|
||||
}
|
||||
}
|
|
@ -5,6 +5,7 @@ import nl.netsoj.chris.Jellyfin 1.0
|
|||
|
||||
import "../components"
|
||||
|
||||
// Test
|
||||
Page {
|
||||
id: page
|
||||
|
||||
|
@ -90,11 +91,13 @@ Page {
|
|||
delegate: LibraryItemDelegate {
|
||||
property string id: model.id
|
||||
title: model.name
|
||||
poster: ApiClient.baseUrl + "/Items/" + model.id + "/Images/Primary?maxHeight=" + height + "&tag=" + model.imageTags["Primary"]
|
||||
poster: model.imageTags["Primary"] ? ApiClient.baseUrl + "/Items/" + model.id
|
||||
+ "/Images/Primary?maxHeight=" + height + "&tag=" + model.imageTags["Primary"]
|
||||
: ""
|
||||
landscape: true
|
||||
|
||||
onClicked: {
|
||||
pageStack.push(Qt.resolvedUrl("DetailBasePage.qml"), {"itemId": model.id})
|
||||
pageStack.push(Qt.resolvedUrl("DetailPage.qml"), {"itemId": model.id})
|
||||
}
|
||||
}
|
||||
HorizontalScrollDecorator {}
|
||||
|
|
37
qml/pages/VideoPage.qml
Normal file
37
qml/pages/VideoPage.qml
Normal file
|
@ -0,0 +1,37 @@
|
|||
import QtQuick 2.6
|
||||
import Sailfish.Silica 1.0
|
||||
|
||||
import "../components"
|
||||
|
||||
Page {
|
||||
id: videoPage
|
||||
property string itemId
|
||||
property var itemData
|
||||
allowedOrientations: Orientation.All
|
||||
palette.colorScheme: Theme.LightOnDark
|
||||
showNavigationIndicator: videoPlayer.hudVisible
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
color: "black"
|
||||
}
|
||||
|
||||
VideoPlayer {
|
||||
id: videoPlayer
|
||||
anchors.fill: parent
|
||||
itemId: videoPage.itemId
|
||||
onLandscapeChanged: {
|
||||
console.log("Is landscape: " + landscape)
|
||||
//appWindow.orientation = landscape ? Orientation.Landscape : Orientation.Portrait
|
||||
videoPage.allowedOrientations = landscape ? Orientation.LandscapeMask : Orientation.PortraitMask
|
||||
}
|
||||
player: appWindow.mediaPlayer
|
||||
title: itemData.Name
|
||||
}
|
||||
|
||||
onStatusChanged: {
|
||||
if (status == PageStatus.Inactive) {
|
||||
videoPlayer.stop()
|
||||
}
|
||||
}
|
||||
}
|
|
@ -2,7 +2,7 @@ import QtQuick 2.6
|
|||
import Sailfish.Silica 1.0
|
||||
import nl.netsoj.chris.Jellyfin 1.0
|
||||
|
||||
import "../components"
|
||||
import "../../components"
|
||||
|
||||
Dialog {
|
||||
property string loginMessage
|
||||
|
@ -27,7 +27,7 @@ Dialog {
|
|||
onAuthenticatedChanged: {
|
||||
if (ApiClient.authenticated) {
|
||||
console.log("authenticated!")
|
||||
pageStack.replaceAbove(pageStack.previousPage(firstPage), Qt.resolvedUrl("MainPage.qml"))
|
||||
pageStack.replaceAbove(pageStack.previousPage(firstPage), Qt.resolvedUrl("../MainPage.qml"))
|
||||
}
|
||||
}
|
||||
onAuthenticationError: {
|
0
qml/pages/setup/a
Normal file
0
qml/pages/setup/a
Normal file
Loading…
Add table
Add a link
Reference in a new issue