Commit bad9d211 authored by Noah Davis's avatar Noah Davis 🌵
Browse files

VideoPlayer: set implicit size, expose Video status as a property

parent 786d4255
......@@ -18,6 +18,7 @@ Item {
property string source
readonly property alias player: videoPlayer
readonly property bool playing: videoPlayer.playbackState === MediaPlayer.PlayingState
readonly property alias status: videoPlayer.status
// signals when playback starts and finishes
signal playbackStarted()
......@@ -28,6 +29,9 @@ Item {
videoPlayer.play();
}
implicitWidth: videoPlayer.implicitWidth
implicitHeight: videoPlayer.implicitHeight
Timer {
id: doubleClickTimer
interval: 150
......@@ -54,6 +58,8 @@ Item {
Video {
id: videoPlayer
implicitWidth: videoPlayer.metaData.resolution ? videoPlayer.metaData.resolution.width : 0
implicitHeight: videoPlayer.metaData.resolution ? videoPlayer.metaData.resolution.height : 0
anchors.fill: parent
loops: videoPlayer.duration >= 5000 ? 0 : MediaPlayer.Infinite // loop short videos
// See https://doc.qt.io/qt-5/qml-qtmultimedia-qtmultimedia.html#convertVolume-method
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment