updates #1795: Only download metadata for video files
This commit is contained in:
parent
c6c65749bb
commit
c3102561f4
|
@ -1973,8 +1973,7 @@
|
|||
let media = view.el.querySelector('.chat-msg .chat-msg__media');
|
||||
expect(media.innerHTML.replace(/(\r\n|\n|\r)/gm, "")).toEqual(
|
||||
'<!-- src/templates/video.html -->'+
|
||||
'<video controls="" 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>');
|
||||
'<video controls="" preload="metadata" src="https://montague.lit/video.mp4" style="max-height: 50vh"></video>');
|
||||
|
||||
// If the <url> and <body> contents is the same, don't duplicate.
|
||||
stanza = u.toStanza(`
|
||||
|
@ -1991,8 +1990,7 @@
|
|||
media = view.el.querySelector('.chat-msg:last-child .chat-msg__media');
|
||||
expect(media.innerHTML.replace(/(\r\n|\n|\r)/gm, "")).toEqual(
|
||||
'<!-- src/templates/video.html -->'+
|
||||
'<video controls="" 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>');
|
||||
'<video controls="" preload="metadata" src="https://montague.lit/video.mp4" style="max-height: 50vh"></video>');
|
||||
done();
|
||||
}));
|
||||
|
||||
|
|
|
@ -1,2 +1 @@
|
|||
<video controls src="{{{o.url}}}" style="max-height: 50vh"></video>
|
||||
<a target="_blank" rel="noopener" href="{{{o.url}}}">{{{o.label_download}}}</a>
|
||||
<video controls preload="metadata" src="{{{o.url}}}" style="max-height: 50vh"></video>
|
||||
|
|
|
@ -223,11 +223,7 @@ u.renderImageURLs = function (_converse, el) {
|
|||
u.renderMovieURL = function (_converse, url) {
|
||||
const uri = new URI(url);
|
||||
if (u.isVideoURL(uri)) {
|
||||
const { __ } = _converse;
|
||||
return tpl_video({
|
||||
'url': url,
|
||||
'label_download': __('Download video file "%1$s"', decodeURI(uri.filename()))
|
||||
})
|
||||
return tpl_video({url});
|
||||
}
|
||||
return url;
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue
Block a user