From d44186f57dfe269d168edb5a6b3e4e29d7bb157c Mon Sep 17 00:00:00 2001 From: link2xt Date: Sun, 30 May 2021 06:44:02 +0300 Subject: Add video viewer --- qml/Message.qml | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/qml/Message.qml b/qml/Message.qml index 68b2979..6346124 100644 --- a/qml/Message.qml +++ b/qml/Message.qml @@ -82,6 +82,29 @@ RowLayout { } } + Component { + id: videoMessageView + + ColumnLayout { + MediaPlayer { + id: videoplayer + source: Qt.resolvedUrl("file:" + messageObject.message.file) + } + VideoOutput { + source: videoplayer + } + Label { + font.bold: true + text: "Video" + textFormat: Text.PlainText + } + Button { + text: "play" + onPressed: videoplayer.play() + } + } + } + Component { id: textMessageView @@ -131,7 +154,9 @@ RowLayout { Loader { sourceComponent: [20, 21, 23].includes(messageObject.message.viewtype) ? imageMessageView - : [40, 41].includes(messageObject.message.viewtype) ? audioMessageView : textMessageView + : [40, 41].includes(messageObject.message.viewtype) ? audioMessageView + : [50].includes(messageObject.message.viewtype) ? videoMessageView + : textMessageView } // Quote -- cgit v1.2.3-70-g09d2