summaryrefslogtreecommitdiffstats
path: root/examples/multimedia/video
diff options
context:
space:
mode:
Diffstat (limited to 'examples/multimedia/video')
-rw-r--r--examples/multimedia/video/CMakeLists.txt4
-rw-r--r--examples/multimedia/video/mediaplayer/AudioControl.qml1
-rw-r--r--examples/multimedia/video/mediaplayer/CMakeLists.txt4
-rw-r--r--examples/multimedia/video/mediaplayer/PlaybackControl.qml36
-rw-r--r--examples/multimedia/video/mediaplayer/PlaybackRateControl.qml2
5 files changed, 31 insertions, 16 deletions
diff --git a/examples/multimedia/video/CMakeLists.txt b/examples/multimedia/video/CMakeLists.txt
index 6174726c0..e5bc20ba9 100644
--- a/examples/multimedia/video/CMakeLists.txt
+++ b/examples/multimedia/video/CMakeLists.txt
@@ -3,7 +3,9 @@
add_subdirectory(qmlvideo)
add_subdirectory(qmlvideofx)
if(TARGET Qt::QuickControls2)
- add_subdirectory(mediaplayer)
+ if(TARGET Qt::Svg)
+ add_subdirectory(mediaplayer)
+ endif()
add_subdirectory(recorder)
endif()
if(ANDROID)
diff --git a/examples/multimedia/video/mediaplayer/AudioControl.qml b/examples/multimedia/video/mediaplayer/AudioControl.qml
index a3f911b89..7e504bc5c 100644
--- a/examples/multimedia/video/mediaplayer/AudioControl.qml
+++ b/examples/multimedia/video/mediaplayer/AudioControl.qml
@@ -60,7 +60,6 @@ Item {
property bool muted: false
property real volume: volumeSlider.value/100.
- implicitWidth: 150
implicitHeight: buttons.height
RowLayout {
diff --git a/examples/multimedia/video/mediaplayer/CMakeLists.txt b/examples/multimedia/video/mediaplayer/CMakeLists.txt
index 8626c2e22..9522da30e 100644
--- a/examples/multimedia/video/mediaplayer/CMakeLists.txt
+++ b/examples/multimedia/video/mediaplayer/CMakeLists.txt
@@ -24,7 +24,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
# endif()
#endif()
-find_package(Qt6 COMPONENTS Core Quick QuickControls2 REQUIRED)
+find_package(Qt6 COMPONENTS Core Quick QuickControls2 Svg REQUIRED)
set(PROJECT_SOURCES
main.cpp
@@ -42,4 +42,4 @@ qt6_add_resources(mediaplayer "mediaplayer"
target_compile_definitions(mediaplayer
PRIVATE $<$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:QT_QML_DEBUG>)
target_link_libraries(mediaplayer
- PRIVATE Qt6::Core Qt6::Quick Qt6::QuickControls2)
+ PRIVATE Qt6::Core Qt6::Quick Qt6::QuickControls2 Qt6::Svg)
diff --git a/examples/multimedia/video/mediaplayer/PlaybackControl.qml b/examples/multimedia/video/mediaplayer/PlaybackControl.qml
index 6744d2b6d..ee2ba6ed4 100644
--- a/examples/multimedia/video/mediaplayer/PlaybackControl.qml
+++ b/examples/multimedia/video/mediaplayer/PlaybackControl.qml
@@ -61,7 +61,8 @@ Item {
property alias muted: audio.muted
property alias volume: audio.volume
- implicitHeight: 80
+ height: frame.height
+
opacity: 1
Behavior on opacity { NumberAnimation { duration: 300 }}
@@ -90,7 +91,10 @@ Item {
}
Frame {
- anchors.fill: parent
+ id: frame
+ anchors.left: parent.left
+ anchors.right: parent.right
+ anchors.bottom: parent.bottom
background: Rectangle {
color: "white"
@@ -107,21 +111,27 @@ Item {
mediaPlayer: root.mediaPlayer
}
- Item {
+ RowLayout {
id: playerButtons
Layout.fillWidth: true
- Layout.fillHeight: true
PlaybackRateControl {
- anchors.left: parent.left
- anchors.top: parent.top
- anchors.bottom: parent.bottom
+ Layout.minimumWidth: 100
+ Layout.maximumWidth: 150
+ Layout.fillHeight: true
+ Layout.fillWidth: true
mediaPlayer: root.mediaPlayer
}
+ Item {
+ Layout.fillWidth: true
+ }
+
RowLayout {
- anchors.centerIn: parent
+ Layout.alignment: Qt.AlignCenter
+ id: controlButtons
+
RoundButton {
id: pauseButton
radius: 50.0
@@ -144,11 +154,15 @@ Item {
}
}
+ Item {
+ Layout.fillWidth: true
+ }
+
AudioControl {
id: audio
- anchors.right: parent.right
- anchors.top: parent.top
- anchors.bottom: parent.bottom
+ Layout.minimumWidth: 100
+ Layout.maximumWidth: 150
+ Layout.fillWidth: true
mediaPlayer: root.mediaPlayer
}
}
diff --git a/examples/multimedia/video/mediaplayer/PlaybackRateControl.qml b/examples/multimedia/video/mediaplayer/PlaybackRateControl.qml
index 24596538c..99c151a77 100644
--- a/examples/multimedia/video/mediaplayer/PlaybackRateControl.qml
+++ b/examples/multimedia/video/mediaplayer/PlaybackRateControl.qml
@@ -63,7 +63,7 @@ Item {
Slider {
id: slider
- Layout.minimumWidth: 50
+ Layout.fillWidth: true
snapMode: Slider.SnapOnRelease
enabled: true
from: 0.5