Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
converse.js
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
converse.js
Commits
c3102561
Commit
c3102561
authored
Dec 18, 2019
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updates #1795: Only download metadata for video files
parent
c6c65749
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
11 deletions
+4
-11
spec/messages.js
spec/messages.js
+2
-4
src/templates/video.html
src/templates/video.html
+1
-2
src/utils/html.js
src/utils/html.js
+1
-5
No files found.
spec/messages.js
View file @
c3102561
...
@@ -1973,8 +1973,7 @@
...
@@ -1973,8 +1973,7 @@
let
media
=
view
.
el
.
querySelector
(
'
.chat-msg .chat-msg__media
'
);
let
media
=
view
.
el
.
querySelector
(
'
.chat-msg .chat-msg__media
'
);
expect
(
media
.
innerHTML
.
replace
(
/
(\r\n
|
\n
|
\r)
/gm
,
""
)).
toEqual
(
expect
(
media
.
innerHTML
.
replace
(
/
(\r\n
|
\n
|
\r)
/gm
,
""
)).
toEqual
(
'
<!-- src/templates/video.html -->
'
+
'
<!-- src/templates/video.html -->
'
+
'
<video controls="" src="https://montague.lit/video.mp4" style="max-height: 50vh"></video>
'
+
'
<video controls="" preload="metadata" src="https://montague.lit/video.mp4" style="max-height: 50vh"></video>
'
);
'
<a target="_blank" rel="noopener" href="https://montague.lit/video.mp4">Download video file "video.mp4"</a>
'
);
// If the <url> and <body> contents is the same, don't duplicate.
// If the <url> and <body> contents is the same, don't duplicate.
stanza
=
u
.
toStanza
(
`
stanza
=
u
.
toStanza
(
`
...
@@ -1991,8 +1990,7 @@
...
@@ -1991,8 +1990,7 @@
media
=
view
.
el
.
querySelector
(
'
.chat-msg:last-child .chat-msg__media
'
);
media
=
view
.
el
.
querySelector
(
'
.chat-msg:last-child .chat-msg__media
'
);
expect
(
media
.
innerHTML
.
replace
(
/
(\r\n
|
\n
|
\r)
/gm
,
""
)).
toEqual
(
expect
(
media
.
innerHTML
.
replace
(
/
(\r\n
|
\n
|
\r)
/gm
,
""
)).
toEqual
(
'
<!-- src/templates/video.html -->
'
+
'
<!-- src/templates/video.html -->
'
+
'
<video controls="" src="https://montague.lit/video.mp4" style="max-height: 50vh"></video>
'
+
'
<video controls="" preload="metadata" src="https://montague.lit/video.mp4" style="max-height: 50vh"></video>
'
);
'
<a target="_blank" rel="noopener" href="https://montague.lit/video.mp4">Download video file "video.mp4"</a>
'
);
done
();
done
();
}));
}));
...
...
src/templates/video.html
View file @
c3102561
<video
controls
src=
"{{{o.url}}}"
style=
"max-height: 50vh"
></video>
<video
controls
preload=
"metadata"
src=
"{{{o.url}}}"
style=
"max-height: 50vh"
></video>
<a
target=
"_blank"
rel=
"noopener"
href=
"{{{o.url}}}"
>
{{{o.label_download}}}
</a>
src/utils/html.js
View file @
c3102561
...
@@ -223,11 +223,7 @@ u.renderImageURLs = function (_converse, el) {
...
@@ -223,11 +223,7 @@ u.renderImageURLs = function (_converse, el) {
u
.
renderMovieURL
=
function
(
_converse
,
url
)
{
u
.
renderMovieURL
=
function
(
_converse
,
url
)
{
const
uri
=
new
URI
(
url
);
const
uri
=
new
URI
(
url
);
if
(
u
.
isVideoURL
(
uri
))
{
if
(
u
.
isVideoURL
(
uri
))
{
const
{
__
}
=
_converse
;
return
tpl_video
({
url
});
return
tpl_video
({
'
url
'
:
url
,
'
label_download
'
:
__
(
'
Download video file "%1$s"
'
,
decodeURI
(
uri
.
filename
()))
})
}
}
return
url
;
return
url
;
};
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment