fixed the embeds

This commit is contained in:
CatAClock 2025-05-22 16:43:42 -07:00
parent 0471806b7b
commit 57f7f2628e

View file

@ -197,16 +197,16 @@ async function CreateMedia(Media, Element, Author = undefined) {
var Texty = await BlueskyAPI.GetPosts([Media.embed.record.uri]);
console.log(Texty);
Element.innerHTML += "<p class='Embed'>" + Texty.posts[0].record.text + "</p><br/>";
if (Texty.posts[0].embed.$type == "app.bsky.embed.images") {
for (let i of Texty.posts[0].embed.images) {
var Blobby = await BlueskyAPI.GetBlob(Author, i.image.ref.$link);
if (Texty.posts[0].record.embed.$type == "app.bsky.embed.images") {
for (let i of Texty.posts[0].record.embed.images) {
var Blobby = await BlueskyAPI.GetBlob(Texty.posts[0].author.did, i.image.ref.$link);
var ObjectURL = URL.createObjectURL(Blobby);
Element.innerHTML += "<img src=" + ObjectURL + " alt='" + i.alt + "'/>";
Element.innerHTML += "<img class='Embed' src=" + ObjectURL + " alt='" + i.alt + "'/>";
}
} else if (Media.embed.$type == "app.bsky.embed.video") {
var Blobby = await BlueskyAPI.GetBlob(Author, Texty.posts[0].embed.video.ref.$link);
} else if (Texty.posts[0].record.embed.$type == "app.bsky.embed.video") {
var Blobby = await BlueskyAPI.GetBlob(Texty.posts[0].author.did, Texty.posts[0].record.embed.video.ref.$link);
var ObjectURL = URL.createObjectURL(Blobby);
Element.innerHTML += "<video controls src=" + ObjectURL + "></video>";
Element.innerHTML += "<video class='Embed' controls src=" + ObjectURL + "></video>";
}
// It's not an embed, continue...
} else if (Media.embed.$type == "app.bsky.embed.images") {