Support video events, new media player

This commit is contained in:
miruka
2019-09-17 16:30:04 -04:00
parent 76ffdfd28a
commit 692749e72f
32 changed files with 605 additions and 22 deletions

View File

@@ -130,12 +130,6 @@ Column {
contextMenu.media[0] === EventDelegate.Media.Image ?
qsTr("Copy image address") :
contextMenu.media[0] === EventDelegate.Media.Video ?
qsTr("Copy video address") :
contextMenu.media[0] === EventDelegate.Media.Audio ?
qsTr("Copy audio address") :
qsTr("Copy media address")
visible: Boolean(text)

View File

@@ -65,6 +65,10 @@ HLoader {
fileSize: info.media_size,
}
} else if (type === EventDelegate.Media.Video) {
var file = "EventVideo.qml"
var props = { source: mediaUrl }
} else { return }
loader.setSource(file, props)

View File

@@ -0,0 +1,19 @@
import QtQuick 2.12
import QtQuick.Layouts 1.12
import QtAV 1.7
import "../../Base"
import "../../Base/MediaPlayer"
import "../../utils.js" as Utils
VideoPlayer {
id: video
width: fullScreen ? implicitWidth : Math.min(
mainColumn.width - eventContent.spacing * 2,
theme.chat.message.videoWidth,
)
onHoveredChanged: {
eventDelegate.hoveredMediaTypeUrl =
hovered ? [EventDelegate.Media.Video, video.source] : []
}
}