1
0
Fork 0
mirror of https://github.com/HenkKalkwater/harbour-sailfin.git synced 2024-11-16 06:25:18 +00:00
harbour-sailfin/qml/pages/VideoPage.qml

49 lines
1.2 KiB
QML
Raw Normal View History

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