Make VideoPage work again
This commit is contained in:
parent
9299205379
commit
7e6c871261
1 changed files with 18 additions and 19 deletions
|
@ -27,7 +27,7 @@ Item {
|
||||||
|
|
||||||
property ListItem messageListItem
|
property ListItem messageListItem
|
||||||
property MessageOverlayFlickable overlayFlickable
|
property MessageOverlayFlickable overlayFlickable
|
||||||
property var rawMessage: messageListItem ? messageListItem.myMessage : overlayFlickable.overlayMessage
|
property var rawMessage: messageListItem ? messageListItem.myMessage : ( overlayFlickable ? overlayFlickable.overlayMessage : undefined )
|
||||||
|
|
||||||
property var videoData: ( rawMessage.content['@type'] === "messageVideo" ) ? rawMessage.content.video : ( ( rawMessage.content['@type'] === "messageAnimation" ) ? rawMessage.content.animation : rawMessage.content.video_note )
|
property var videoData: ( rawMessage.content['@type'] === "messageVideo" ) ? rawMessage.content.video : ( ( rawMessage.content['@type'] === "messageAnimation" ) ? rawMessage.content.animation : rawMessage.content.video_note )
|
||||||
property string videoUrl;
|
property string videoUrl;
|
||||||
|
@ -89,7 +89,7 @@ Item {
|
||||||
|
|
||||||
videoMessageComponent.videoType = videoMessageComponent.isVideoNote ? "video" : videoData['@type'];
|
videoMessageComponent.videoType = videoMessageComponent.isVideoNote ? "video" : videoData['@type'];
|
||||||
videoFileId = videoData[videoType].id;
|
videoFileId = videoData[videoType].id;
|
||||||
if (rawMessage.content['@type'] === "messageAnimation") {
|
if (typeof rawMessage !== "undefined" && rawMessage.content['@type'] === "messageAnimation") {
|
||||||
playButton.visible = true;
|
playButton.visible = true;
|
||||||
fullscreenButton.visible = !videoMessageComponent.fullscreen;
|
fullscreenButton.visible = !videoMessageComponent.fullscreen;
|
||||||
handlePlay();
|
handlePlay();
|
||||||
|
@ -294,21 +294,6 @@ Item {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Connections {
|
|
||||||
target: videoMessageComponent
|
|
||||||
onClicked: {
|
|
||||||
if (messageVideo.playbackState === MediaPlayer.PlayingState) {
|
|
||||||
enableScreensaver();
|
|
||||||
messageVideo.pause();
|
|
||||||
timeLeftItem.visible = true;
|
|
||||||
} else {
|
|
||||||
disableScreensaver();
|
|
||||||
messageVideo.play();
|
|
||||||
timeLeftTimer.start();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Video {
|
Video {
|
||||||
id: messageVideo
|
id: messageVideo
|
||||||
|
|
||||||
|
@ -367,7 +352,7 @@ Item {
|
||||||
height: parent.height
|
height: parent.height
|
||||||
source: videoUrl
|
source: videoUrl
|
||||||
layer.enabled: videoMessageComponent.highlighted
|
layer.enabled: videoMessageComponent.highlighted
|
||||||
layer.effect: PressEffect { source: singleImage }
|
layer.effect: PressEffect { source: messageVideo }
|
||||||
onStopped: {
|
onStopped: {
|
||||||
enableScreensaver();
|
enableScreensaver();
|
||||||
messageVideo.visible = false;
|
messageVideo.visible = false;
|
||||||
|
@ -376,6 +361,21 @@ Item {
|
||||||
videoComponentLoader.active = false;
|
videoComponentLoader.active = false;
|
||||||
fullscreenItem.visible = !videoMessageComponent.fullscreen;
|
fullscreenItem.visible = !videoMessageComponent.fullscreen;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
anchors.fill: parent
|
||||||
|
onClicked: {
|
||||||
|
if (messageVideo.playbackState === MediaPlayer.PlayingState) {
|
||||||
|
enableScreensaver();
|
||||||
|
messageVideo.pause();
|
||||||
|
timeLeftItem.visible = true;
|
||||||
|
} else {
|
||||||
|
disableScreensaver();
|
||||||
|
messageVideo.play();
|
||||||
|
timeLeftTimer.start();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
BusyIndicator {
|
BusyIndicator {
|
||||||
|
@ -514,7 +514,6 @@ Item {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue