2020-09-25 12:46:39 +00:00
|
|
|
import QtQuick 2.6
|
|
|
|
import Sailfish.Silica 1.0
|
|
|
|
|
|
|
|
import "../components"
|
|
|
|
|
2020-09-25 13:21:08 +00:00
|
|
|
/**
|
|
|
|
* Page only containing a video player.
|
|
|
|
*
|
|
|
|
* On larger devices the video player could potentially be embedded somewhere else.
|
|
|
|
*/
|
|
|
|
|
2020-09-25 12:46:39 +00:00
|
|
|
Page {
|
|
|
|
id: videoPage
|
|
|
|
property string itemId
|
|
|
|
property var itemData
|
2020-09-25 15:14:44 +00:00
|
|
|
property int audioTrack
|
|
|
|
property int subtitleTrack
|
|
|
|
|
2020-09-25 12:46:39 +00:00
|
|
|
allowedOrientations: Orientation.All
|
|
|
|
showNavigationIndicator: videoPlayer.hudVisible
|
|
|
|
|
|
|
|
VideoPlayer {
|
|
|
|
id: videoPlayer
|
|
|
|
anchors.fill: parent
|
|
|
|
itemId: videoPage.itemId
|
2020-09-25 13:21:08 +00:00
|
|
|
player: appWindow.mediaPlayer
|
|
|
|
title: itemData.Name
|
2020-09-25 15:14:44 +00:00
|
|
|
audioTrack: videoPage.audioTrack
|
|
|
|
subtitleTrack: videoPage.subtitleTrack
|
2020-09-25 13:21:08 +00:00
|
|
|
|
2020-09-25 12:46:39 +00:00
|
|
|
onLandscapeChanged: {
|
|
|
|
console.log("Is landscape: " + landscape)
|
|
|
|
//appWindow.orientation = landscape ? Orientation.Landscape : Orientation.Portrait
|
|
|
|
videoPage.allowedOrientations = landscape ? Orientation.LandscapeMask : Orientation.PortraitMask
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
onStatusChanged: {
|
2020-09-25 15:14:44 +00:00
|
|
|
switch(status) {
|
|
|
|
case PageStatus.Inactive:
|
2020-09-25 12:46:39 +00:00
|
|
|
videoPlayer.stop()
|
2020-09-25 15:14:44 +00:00
|
|
|
break;
|
|
|
|
case PageStatus.Active:
|
|
|
|
appWindow.itemData = videoPage.itemData
|
|
|
|
break;
|
2020-09-25 12:46:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|