summaryrefslogtreecommitdiffstats
path: root/app/VideoPlayer.qml
diff options
context:
space:
mode:
Diffstat (limited to 'app/VideoPlayer.qml')
-rw-r--r--app/VideoPlayer.qml192
1 files changed, 102 insertions, 90 deletions
diff --git a/app/VideoPlayer.qml b/app/VideoPlayer.qml
index 7eb252e..4fae69d 100644
--- a/app/VideoPlayer.qml
+++ b/app/VideoPlayer.qml
@@ -63,123 +63,126 @@ ApplicationWindow {
Layout.fillHeight: true
Layout.preferredHeight: 1080
clip: true
+
VideoOutput {
source: player
- anchors.top: parent.top
- anchors.left: parent.left
- anchors.right: parent.right
- anchors.bottom: controls.top
+ anchors.fill: parent
Rectangle {
anchors.fill: parent
color: 'black'
opacity: 0.75
z: -1
}
- }
- Item {
- id: controls
- anchors.left: parent.left
- anchors.right: parent.right
- anchors.bottom: parent.bottom
- height: 307
- Rectangle {
+ MouseArea{
anchors.fill: parent
- color: 'black'
- opacity: 0.75
+ onClicked:{
+ controls.visible = !controls.visible;
+ }
}
- ColumnLayout {
- anchors.fill: parent
- anchors.margins: root.width * 0.02
- Item {
- Layout.fillWidth: true
- Layout.fillHeight: true
- Row {
- spacing: 20
- ToggleButton {
- id: random
- offImage: './images/AGL_MediaPlayer_Shuffle_Inactive.svg'
- onImage: './images/AGL_MediaPlayer_Shuffle_Active.svg'
+ Item {
+ id: controls
+ anchors.left: parent.left
+ anchors.right: parent.right
+ anchors.bottom: parent.bottom
+ visible: false
+ height: 240
+ z: 100
+
+ ColumnLayout {
+ anchors.fill: parent
+ anchors.margins: 5
+ Item {
+ Layout.fillWidth: true
+ Layout.fillHeight: true
+ Row {
+ spacing: 20
+ ToggleButton {
+ id: random
+ offImage: './images/AGL_MediaPlayer_Shuffle_Inactive.svg'
+ onImage: './images/AGL_MediaPlayer_Shuffle_Active.svg'
+ }
+ ToggleButton {
+ id: loop
+ offImage: './images/AGL_MediaPlayer_Loop_Inactive.svg'
+ onImage: './images/AGL_MediaPlayer_Loop_Active.svg'
+ }
}
- ToggleButton {
- id: loop
- offImage: './images/AGL_MediaPlayer_Loop_Inactive.svg'
- onImage: './images/AGL_MediaPlayer_Loop_Active.svg'
+ ColumnLayout {
+ anchors.fill: parent
+ Label {
+ id: title
+ Layout.alignment: Layout.Center
+ text: player.metaData.title ? player.metaData.title : ''
+ horizontalAlignment: Label.AlignHCenter
+ verticalAlignment: Label.AlignVCenter
+ }
+ Label {
+ id: artist
+ Layout.alignment: Layout.Center
+ text: player.metaData.author ? player.metaData.author : ''
+ horizontalAlignment: Label.AlignHCenter
+ verticalAlignment: Label.AlignVCenter
+ font.pixelSize: title.font.pixelSize * 0.6
+ }
}
}
- ColumnLayout {
- anchors.fill: parent
+ Slider {
+ id: slider
+ Layout.fillWidth: true
+ to: player.duration
Label {
- id: title
- Layout.alignment: Layout.Center
- text: player.metaData.title ? player.metaData.title : ''
- horizontalAlignment: Label.AlignHCenter
- verticalAlignment: Label.AlignVCenter
+ id: position
+ anchors.left: parent.left
+ anchors.bottom: parent.top
+ font.pixelSize: 24
+ text: player.time2str(player.position)
}
Label {
- id: artist
- Layout.alignment: Layout.Center
- text: player.metaData.author ? player.metaData.author : ''
- horizontalAlignment: Label.AlignHCenter
- verticalAlignment: Label.AlignVCenter
- font.pixelSize: title.font.pixelSize * 0.6
+ id: duration
+ anchors.right: parent.right
+ anchors.bottom: parent.top
+ font.pixelSize: 24
+ text: player.time2str(player.duration)
}
+ onPressedChanged: player.seek(value)
}
- }
- Slider {
- id: slider
- Layout.fillWidth: true
- to: player.duration
- Label {
- id: position
- anchors.left: parent.left
- anchors.bottom: parent.top
- font.pixelSize: 32
- text: player.time2str(player.position)
- }
- Label {
- id: duration
- anchors.right: parent.right
- anchors.bottom: parent.top
- font.pixelSize: 32
- text: player.time2str(player.duration)
- }
- onPressedChanged: player.seek(value)
- }
- RowLayout {
- Layout.fillHeight: true
- Item { Layout.fillWidth: true }
- ImageButton {
- offImage: './images/AGL_MediaPlayer_BackArrow.svg'
- onClicked: playlist.previous()
- }
- ImageButton {
- id: play
- offImage: './images/AGL_MediaPlayer_Player_Play.svg'
- onClicked: player.play()
- states: [
- State {
- when: player.playbackState === MediaPlayer.PlayingState
- PropertyChanges {
- target: play
- offImage: './images/AGL_MediaPlayer_Player_Pause.svg'
- onClicked: player.pause()
+ RowLayout {
+ Layout.fillHeight: true
+ Item { Layout.fillWidth: true }
+ ImageButton {
+ offImage: './images/AGL_MediaPlayer_BackArrow.svg'
+ onClicked: playlist.previous()
+ }
+ ImageButton {
+ id: play
+ offImage: './images/AGL_MediaPlayer_Player_Play.svg'
+ onClicked: player.play()
+ states: [
+ State {
+ when: player.playbackState === MediaPlayer.PlayingState
+ PropertyChanges {
+ target: play
+ offImage: './images/AGL_MediaPlayer_Player_Pause.svg'
+ onClicked: player.pause()
+ }
}
- }
- ]
- }
- ImageButton {
- offImage: './images/AGL_MediaPlayer_ForwardArrow.svg'
- onClicked: playlist.next()
- }
+ ]
+ }
+ ImageButton {
+ offImage: './images/AGL_MediaPlayer_ForwardArrow.svg'
+ onClicked: playlist.next()
+ }
- Item { Layout.fillWidth: true }
+ Item { Layout.fillWidth: true }
+ }
}
}
}
}
Item {
+ id: playlistArea
Layout.fillWidth: true
Layout.fillHeight: true
Layout.preferredHeight: 407
@@ -229,4 +232,13 @@ ApplicationWindow {
}
}
}
+
+
+ function changeArea(area) {
+ if (area === 'normal') {
+ playlistArea.visible = true;
+ } else {
+ playlistArea.visible = false;
+ }
+ }
}