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) { // if ($.inArray(disembed.type, ["rich", "link", "video"]) == -1) {
// continue; // continue;
// } // }
disembed.isVideo = false;
if (disembed.type == "video") {
disembed.isVideo = true;
}
disembed.toRenderFooter = false; disembed.toRenderFooter = false;
if (disembed.footer) { if (disembed.footer) {
disembed.toRenderFooter = true; disembed.toRenderFooter = true;

View File

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