Warning, /maui/arca/src/controls/previewer/VideoPreview.qml is written in an unsupported language. File is not indexed.
0001 import QtQuick 2.9 0002 import QtQuick.Controls 2.2 0003 import QtQuick.Layouts 1.3 0004 0005 import QtMultimedia 5.8 0006 0007 import org.mauikit.controls 1.0 as Maui 0008 0009 Maui.Page 0010 { 0011 id: control 0012 property alias player : player 0013 headBar.visible: false 0014 0015 Video 0016 { 0017 id: player 0018 anchors.fill: parent 0019 source: currentUrl 0020 autoLoad: true 0021 autoPlay: true 0022 loops: 3 0023 property string codec : player.metaData.videoCodec 0024 0025 onCodecChanged: 0026 { 0027 infoModel.append({key:"Title", value: player.metaData.title}) 0028 infoModel.append({key:"Camera", value: player.metaData.cameraModel}) 0029 infoModel.append({key:"Zoom Ratio", value: player.metaData.digitalZoomRatio}) 0030 infoModel.append({key:"Author", value: player.metaData.author}) 0031 infoModel.append({key:"Audio Codec", value: player.metaData.audioCodec}) 0032 infoModel.append({key:"Video Codec", value: player.metaData.videoCodec}) 0033 infoModel.append({key:"Copyright", value: player.metaData.copyright}) 0034 infoModel.append({key:"Duration", value: player.metaData.duration}) 0035 infoModel.append({key:"Framerate", value: player.metaData.videoFrameRate}) 0036 infoModel.append({key:"Year", value: player.metaData.year}) 0037 infoModel.append({key:"Aspect Ratio", value: player.metaData.pixelAspectRatio}) 0038 infoModel.append({key:"Resolution", value: player.metaData.resolution}) 0039 } 0040 0041 ToolButton 0042 { 0043 visible: player.playbackState == MediaPlayer.StoppedState 0044 anchors.centerIn: parent 0045 icon.color: "transparent" 0046 flat: true 0047 icon.width: Maui.Style.iconSizes.huge 0048 icon.name: iteminfo.icon 0049 } 0050 0051 focus: true 0052 Keys.onSpacePressed: player.playbackState == MediaPlayer.PlayingState ? player.pause() : player.play() 0053 Keys.onLeftPressed: player.seek(player.position - 5000) 0054 Keys.onRightPressed: player.seek(player.position + 5000) 0055 0056 RowLayout 0057 { 0058 anchors.fill: parent 0059 0060 MouseArea 0061 { 0062 Layout.fillWidth: true 0063 Layout.fillHeight: true 0064 onDoubleClicked: player.seek(player.position - 5000) 0065 } 0066 0067 MouseArea 0068 { 0069 Layout.fillWidth: true 0070 Layout.fillHeight: true 0071 onClicked: player.playbackState === MediaPlayer.PlayingState ? player.pause() : player.play() 0072 } 0073 0074 MouseArea 0075 { 0076 Layout.fillWidth: true 0077 Layout.fillHeight: true 0078 onDoubleClicked: player.seek(player.position + 5000) 0079 } 0080 } 0081 } 0082 0083 footBar.visible: true 0084 footBar.background: null 0085 0086 footBar.middleContent : Slider 0087 { 0088 id: _slider 0089 Layout.fillWidth: true 0090 orientation: Qt.Horizontal 0091 from: 0 0092 to: 1000 0093 value: (1000 * player.position) / player.duration 0094 0095 onMoved: player.seek((_slider.value / 1000) * player.duration) 0096 } 0097 }