Changeset View
Changeset View
Standalone View
Standalone View
src/contents/ui/event-types/Video.qml
Show First 20 Lines • Show All 45 Lines • ▼ Show 20 Lines | ColumnLayout { | ||||
property var label: Kazv.SelectableText { | property var label: Kazv.SelectableText { | ||||
Layout.fillWidth: true | Layout.fillWidth: true | ||||
wrapMode: Text.Wrap | wrapMode: Text.Wrap | ||||
text: l10n.get('event-message-video-sent', { gender, body }) | text: l10n.get('event-message-video-sent', { gender, body }) | ||||
} | } | ||||
property var video: Video { | property var video: Video { | ||||
id: video | id: video | ||||
source: videoUri | source: videoUri | ||||
autoLoad: false | |||||
autoPlay: false | |||||
loops: MediaPlayer.Infinite | loops: MediaPlayer.Infinite | ||||
Layout.minimumHeight: Kirigami.Units.gridUnit * 10 | Layout.minimumHeight: Kirigami.Units.gridUnit * 10 | ||||
Layout.minimumWidth: Kirigami.Units.gridUnit * 10 | Layout.minimumWidth: Kirigami.Units.gridUnit * 10 | ||||
Layout.maximumWidth: innerContentWidth | Layout.maximumWidth: innerContentWidth | ||||
Layout.preferredWidth: videoWidth | Layout.preferredWidth: videoWidth | ||||
Layout.preferredHeight: videoHeight / videoWidth * width | Layout.preferredHeight: videoHeight / videoWidth * width | ||||
Show All 15 Lines | ColumnLayout { | ||||
Rectangle { | Rectangle { | ||||
anchors.fill: parent | anchors.fill: parent | ||||
color: Kirigami.Theme.negativeBackgroundColor //Kirigami.ColorUtils.tintWithAlpha(color, Kirigami.Theme.textColor, 0.15) | color: Kirigami.Theme.negativeBackgroundColor //Kirigami.ColorUtils.tintWithAlpha(color, Kirigami.Theme.textColor, 0.15) | ||||
visible: { | visible: { | ||||
video.playbackState == MediaPlayer.StoppedState && | video.playbackState == MediaPlayer.StoppedState && | ||||
! hasThumbnail | ! hasThumbnail | ||||
} | } | ||||
} | |||||
onStatusChanged: { | |||||
console.log('status = ', video.status); | |||||
} | |||||
onPlaybackStateChanged: { | |||||
console.log('playback state = ', video.playbackState); | |||||
} | } | ||||
function playOrPause() { | function playOrPause() { | ||||
console.log('playback state ==', video.playbackState); | console.log('playback state ==', video.playbackState); | ||||
if (video.playbackState == MediaPlayer.PlayingState) { | if (video.playbackState == MediaPlayer.PlayingState) { | ||||
video.pause(); | video.pause(); | ||||
} else { | } else { | ||||
if (video.playbackState == MediaPlayer.StoppedState) { | if (video.playbackState == MediaPlayer.StoppedState) { | ||||
Show All 14 Lines |