refactor: clean up chat and split up embed handling
This commit is contained in:
parent
03751c6d00
commit
7e4ab72fe6
14 changed files with 352 additions and 274 deletions
13
public/js/embeds/mp4.js
Normal file
13
public/js/embeds/mp4.js
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
function embed_mp4(link_info) {
|
||||
if (typeof link_info.extension !== "string") {
|
||||
return;
|
||||
}
|
||||
|
||||
const is_mp4 = get_mime_types(link_info.extension).includes("video/mp4");
|
||||
|
||||
if (!is_mp4) {
|
||||
return;
|
||||
}
|
||||
|
||||
return `<div class="embed-container image gif letterbox"><video autoplay="true" muted="true" loop="true" playsinline="true"><source src="${link_info.url}" type="video/mp4"><a href="${link_info.url}">${link_info.url}</a></video></div>`;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue