Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
Rocket.Chat
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
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
RocketChat
Rocket.Chat
Commits
211c01ff
Commit
211c01ff
authored
9 years ago
by
Rodrigo Nascimento
Browse files
Options
Downloads
Patches
Plain Diff
Render a player for audio files
parent
450fd3f2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
packages/rocketchat-message-attachments/client/messageAttachment.html
+9
-0
9 additions, 0 deletions
...ketchat-message-attachments/client/messageAttachment.html
packages/rocketchat-ui/lib/fileUpload.coffee
+19
-7
19 additions, 7 deletions
packages/rocketchat-ui/lib/fileUpload.coffee
with
28 additions
and
7 deletions
packages/rocketchat-message-attachments/client/messageAttachment.html
+
9
−
0
View file @
211c01ff
...
@@ -62,6 +62,15 @@
...
@@ -62,6 +62,15 @@
</div>
</div>
{{/if}}
{{/if}}
{{#if audio_url}}
<div
class=
"attachment-audio"
>
<audio
controls
>
<source
src=
"{{fixCordova audio_url}}"
type=
"{{audio_type}}"
>
Your browser does not support the audio element.
</audio>
</div>
{{/if}}
{{#if fields}}
{{#if fields}}
<div
class=
"attachment-fields"
>
<div
class=
"attachment-fields"
>
{{#each fields}}
{{#each fields}}
...
...
This diff is collapsed.
Click to expand it.
packages/rocketchat-ui/lib/fileUpload.coffee
+
19
−
7
View file @
211c01ff
...
@@ -87,19 +87,31 @@ readAsArrayBuffer = (file, callback) ->
...
@@ -87,19 +87,31 @@ readAsArrayBuffer = (file, callback) ->
onComplete
:
(
file
)
->
onComplete
:
(
file
)
->
self
=
this
self
=
this
url
=
file
.
url
.
replace
(
Meteor
.
absoluteUrl
(),
'/'
)
url
=
file
.
url
.
replace
(
Meteor
.
absoluteUrl
(),
'/'
)
Meteor
.
call
'sendMessage'
,
{
attachment
=
title
:
"File Uploaded:
#{
file
.
name
}
"
title_link
:
url
if
/^image\/.+/
.
test
file
.
type
attachment
.
image_url
=
url
attachment
.
image_type
=
file
.
type
attachment
.
image_size
=
file
.
size
if
/^audio\/.+/
.
test
file
.
type
attachment
.
audio_url
=
url
attachment
.
audio_type
=
file
.
type
attachment
.
audio_size
=
file
.
size
msg
=
_id
:
Random
.
id
()
_id
:
Random
.
id
()
rid
:
roomId
rid
:
roomId
msg
:
""
msg
:
""
file
:
file
:
_id
:
file
.
_id
_id
:
file
.
_id
groupable
:
false
groupable
:
false
attachments
:
[{
attachments
:
[
attachment
]
image_url
:
url
title
:
"File Uploaded:
#{
file
.
name
}
"
Meteor
.
call
'sendMessage'
,
msg
,
->
title_link
:
url
}]
},
->
Meteor
.
setTimeout
->
Meteor
.
setTimeout
->
uploading
=
Session
.
get
'uploading'
uploading
=
Session
.
get
'uploading'
if
uploading
?
if
uploading
?
...
...
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