Add basic video messages

Size is fixed for now, otherwise the Video output ends up somewhere...
remotes/origin/0.7.0-dev
Nicolas Werner 5 years ago
parent 8a511a7862
commit 67d255a2de
  1. 4
      resources/qml/TimelineView.qml
  2. 12
      resources/qml/delegates/PlayableMediaMessage.qml
  3. 2
      resources/res.qrc

@ -112,8 +112,8 @@ Rectangle {
case MtxEvent.TextMessage: return "delegates/TextMessage.qml"
case MtxEvent.ImageMessage: return "delegates/ImageMessage.qml"
case MtxEvent.FileMessage: return "delegates/FileMessage.qml"
//case MtxEvent.VideoMessage: return "delegates/VideoMessage.qml"
case MtxEvent.AudioMessage: return "delegates/AudioMessage.qml"
case MtxEvent.VideoMessage: return "delegates/PlayableMediaMessage.qml"
case MtxEvent.AudioMessage: return "delegates/PlayableMediaMessage.qml"
case MtxEvent.Redacted: return "delegates/Redacted.qml"
default: return "delegates/placeholder.qml"
}

@ -3,6 +3,8 @@ import QtQuick.Layouts 1.6
import QtQuick.Controls 2.5
import QtMultimedia 5.6
import com.github.nheko 1.0
Rectangle {
radius: 10
color: colors.dark
@ -14,6 +16,15 @@ Rectangle {
width: parent.width - 24
anchors.centerIn: parent
VideoOutput {
visible: eventData.type == MtxEvent.VideoMessage
Layout.maximumHeight: 300
Layout.minimumHeight: 300
Layout.maximumWidth: 500
fillMode: VideoOutput.PreserveAspectFit
source: media
}
RowLayout {
Text {
id: positionText
@ -91,6 +102,7 @@ Rectangle {
id: media
onError: console.log(errorString)
onStatusChanged: if(status == MediaPlayer.Loaded) progress.updatePositionTexts()
autoPlay: true
}
Connections {

@ -122,7 +122,7 @@
<file>qml/delegates/TextMessage.qml</file>
<file>qml/delegates/NoticeMessage.qml</file>
<file>qml/delegates/ImageMessage.qml</file>
<file>qml/delegates/AudioMessage.qml</file>
<file>qml/delegates/PlayableMediaMessage.qml</file>
<file>qml/delegates/FileMessage.qml</file>
<file>qml/delegates/Redacted.qml</file>
<file>qml/delegates/placeholder.qml</file>

Loading…
Cancel
Save