Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Konheko
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nheko Reborn
Konheko
Commits
2870afea
Commit
2870afea
authored
4 years ago
by
Nicolas Werner
Browse files
Options
Downloads
Patches
Plain Diff
[konheko] Add basic audio player and improve video player
parent
e1b28665
No related branches found
No related tags found
No related merge requests found
Pipeline
#137
passed
4 years ago
Stage: build
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
qml/pages/Message.qml
+8
-0
8 additions, 0 deletions
qml/pages/Message.qml
qml/pages/delegates/AudioMessage.qml
+86
-0
86 additions, 0 deletions
qml/pages/delegates/AudioMessage.qml
qml/pages/delegates/VideoMessage.qml
+6
-15
6 additions, 15 deletions
qml/pages/delegates/VideoMessage.qml
with
100 additions
and
15 deletions
qml/pages/Message.qml
+
8
−
0
View file @
2870afea
...
...
@@ -136,6 +136,14 @@ Item {
}
DelegateChoice
{
roleValue
:
EventType
.
AudioMessage
AudioMessage
{
}
}
DelegateChoice
{
Placeholder
{
}
...
...
This diff is collapsed.
Click to expand it.
qml/pages/delegates/AudioMessage.qml
0 → 100644
+
86
−
0
View file @
2870afea
import
QtMultimedia
5.6
import
QtQuick
2.0
import
QtQuick
.
Layouts
1.0
import
Sailfish
.
Media
1.0
import
Sailfish
.
Silica
1.0
ColumnLayout
{
id
:
col
Item
{
id
:
videoContainer
width
:
bubble
.
fullMessageWidth
height
:
width
/
2
MouseArea
{
anchors.fill
:
parent
onClicked
:
{
if
(
player
.
download
==
undefined
)
player
.
download
=
mxcDownloader
.
download
(
model
.
Url
);
}
}
Image
{
id
:
downloadButton
anchors.centerIn
:
parent
visible
:
player
.
status
==
MediaPlayer
.
NoMedia
&&
player
.
download
==
undefined
source
:
"
image://theme/icon-m-cloud-download
"
}
BusyIndicator
{
id
:
busy
size
:
BusyIndicatorSize
.
Medium
anchors.centerIn
:
parent
running
:
player
.
status
==
MediaPlayer
.
NoMedia
&&
player
.
download
!=
undefined
}
MediaPlayer
{
id
:
player
property
var
download
:
mxcDownloader
.
cached
(
model
.
Url
)
?
mxcDownloader
.
download
(
model
.
Url
)
:
undefined
source
:
download
?
download
.
location
:
undefined
autoLoad
:
true
}
MediaPlayerControlsPanel
{
id
:
overlay
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
anchors.bottom
:
parent
.
bottom
z
:
100
duration
:
player
.
duration
/
1000
position
:
player
.
position
/
1000
playing
:
player
.
playbackState
==
MediaPlayer
.
PlayingState
showMenu
:
false
open
:
player
.
hasAudio
onSliderReleased
:
{
player
.
seek
(
value
*
1000
);
}
onPreviousClicked
:
player
.
seek
(
0
)
onPlayPauseClicked
:
{
if
(
player
.
playbackState
==
MediaPlayer
.
PlayingState
)
player
.
pause
();
else
player
.
play
();
}
}
}
Text
{
id
:
body
text
:
model
.
Body
color
:
Theme
.
secondaryColor
wrapMode
:
Text
.
Wrap
width
:
chatView
.
width
font.pixelSize
:
Theme
.
fontSizeTiny
}
}
This diff is collapsed.
Click to expand it.
qml/pages/delegates/VideoMessage.qml
+
6
−
15
View file @
2870afea
...
...
@@ -31,19 +31,11 @@ ColumnLayout {
}
}
Rectangle
{
color
:
'
#00000050
'
anchors.fill
:
parent
visible
:
thumb
.
status
==
Image
.
Error
height
:
chatView
.
width
}
Image
{
id
:
downloadButton
anchors.centerIn
:
thumb
visible
:
thumb
.
status
==
Image
.
Ready
||
thumb
.
status
==
Image
.
Error
//source: "image://theme/icon-m-play"
visible
:
player
.
status
==
MediaPlayer
.
NoMedia
&&
player
.
download
==
undefined
source
:
"
image://theme/icon-m-cloud-download
"
}
...
...
@@ -52,15 +44,14 @@ ColumnLayout {
size
:
BusyIndicatorSize
.
Medium
anchors.centerIn
:
thumb
running
:
thumb
.
status
==
Image
.
Loading
running
:
player
.
status
==
MediaPlayer
.
NoMedia
&&
player
.
download
!=
undefined
}
}
Rectangle
{
Item
{
anchors.fill
:
parent
visible
:
player
.
download
!=
undefined
color
:
"
black
"
visible
:
player
.
hasVideo
MediaPlayer
{
id
:
player
...
...
@@ -76,7 +67,7 @@ ColumnLayout {
source
:
player
anchors.fill
:
parent
visible
:
player
.
download
!=
undefined
visible
:
player
.
hasVideo
MouseArea
{
anchors.fill
:
parent
...
...
@@ -118,7 +109,7 @@ ColumnLayout {
Text
{
id
:
body
text
:
model
.
FormattedBody
+
model
.
Url
text
:
model
.
Body
color
:
Theme
.
secondaryColor
wrapMode
:
Text
.
Wrap
width
:
chatView
.
width
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment