Support video events, new media player
This commit is contained in:
@@ -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)
|
||||
|
@@ -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)
|
||||
|
19
src/qml/Chat/Timeline/EventVideo.qml
Normal file
19
src/qml/Chat/Timeline/EventVideo.qml
Normal 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] : []
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user