Support for video embeds like discord

This commit is contained in:
Jeremy Zhang 2018-06-20 06:23:38 +00:00
parent 4f2266c2b9
commit 764f8bb796
2 changed files with 12 additions and 2 deletions

View File

@ -1110,6 +1110,11 @@
// if ($.inArray(disembed.type, ["rich", "link", "video"]) == -1) {
// continue;
// }
disembed.isVideo = false;
if (disembed.type == "video") {
disembed.isVideo = true;
}
disembed.toRenderFooter = false;
if (disembed.footer) {
disembed.toRenderFooter = true;

View File

@ -401,9 +401,14 @@
" target="_blank">{{title}}</a>
</div>
{{/title}}
{{^isVideo}}
{{#description}}
<div class="description">{{description}}</div>
{{/description}}
{{/isVideo}}
{{#isVideo}}
<iframe class="video" src="{{video.url}}" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
{{/isVideo}}
{{#fields.length}}
<div class="fields">
{{#fields}}
@ -415,11 +420,11 @@
</div>
{{/fields.length}}
</div>
{{#thumbnail}}
{{#thumbnail}}{{^isVideo}}
<div class="thumbnail">
<img src="{{thumbnail.proxy_url}}" class="materialboxed">
</div>
{{/thumbnail}}
{{/isVideo}}{{/thumbnail}}
</div>
{{#image}}
<div class="image">