videos now work on Bsky
This commit is contained in:
parent
d82ca66d12
commit
a1b27d7549
2 changed files with 13 additions and 5 deletions
|
@ -80,9 +80,13 @@ async function GetPost() {
|
||||||
document.getElementsByClassName("Handle")[0].innerHTML = post.post.author.handle;
|
document.getElementsByClassName("Handle")[0].innerHTML = post.post.author.handle;
|
||||||
}
|
}
|
||||||
// Show the image if it exists.
|
// Show the image if it exists.
|
||||||
if (post.post.record.hasOwnProperty("embed") && post.post.record.embed.$type == "app.bsky.embed.images") {
|
if (post.post.record.hasOwnProperty("embed")) {
|
||||||
for (let i of post.post.embed.images) {
|
if (post.post.record.embed.$type == "app.bsky.embed.images") {
|
||||||
document.getElementsByClassName("Images")[0].innerHTML = document.getElementsByClassName("Images")[0].innerHTML + "<img src=" + i.fullsize + " alt='" + i.alt + "'/>";
|
for (let i of post.post.embed.images) {
|
||||||
|
document.getElementsByClassName("Images")[0].innerHTML = document.getElementsByClassName("Images")[0].innerHTML + "<img src=" + i.fullsize + " alt='" + i.alt + "'/>";
|
||||||
|
}
|
||||||
|
} else if (post.post.record.embed.$type == "app.bsky.embed.video") {
|
||||||
|
document.getElementsByClassName("Images")[0].innerHTML = document.getElementsByClassName("Images")[0].innerHTML + "<video controls src=" + i.fullsize + " alt='" + i.alt + "'></video>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// We don't need to update the post with new information. The repos are seperate.
|
// We don't need to update the post with new information. The repos are seperate.
|
||||||
|
|
|
@ -241,8 +241,12 @@ async function PosterContainerUpdate(Direction) {
|
||||||
BlueskyLoadedFeed = CheckForDups(BlueskyLoadedFeed, BlueskyPostsDup, counter);
|
BlueskyLoadedFeed = CheckForDups(BlueskyLoadedFeed, BlueskyPostsDup, counter);
|
||||||
BlueskyPostsDup.push(BlueskyLoadedFeed[counter].post.uri);
|
BlueskyPostsDup.push(BlueskyLoadedFeed[counter].post.uri);
|
||||||
// Check for an image
|
// Check for an image
|
||||||
if (BlueskyLoadedFeed[CurrentThing + counter].post.record.hasOwnProperty("embed") && BlueskyLoadedFeed[CurrentThing + counter].post.record.embed.$type == "app.bsky.embed.images") {
|
if (BlueskyLoadedFeed[CurrentThing + counter].post.record.hasOwnProperty("embed")) {
|
||||||
i.getElementsByClassName("PostContent")[0].innerHTML += "This post has an image!<br/>";
|
if (BlueskyLoadedFeed[CurrentThing + counter].post.record.embed.$type == "app.bsky.embed.images") {
|
||||||
|
i.getElementsByClassName("PostContent")[0].innerHTML += "This post has an image!<br/>";
|
||||||
|
} else if (BlueskyLoadedFeed[CurrentThing + counter].post.record.embed.$type == "app.bsky.embed.video") {
|
||||||
|
i.getElementsByClassName("PostContent")[0].innerHTML += "This post has a video!<br/>";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// Labels
|
// Labels
|
||||||
if (BlueskyLoadedFeed[CurrentThing + counter].post.labels.length != 0) {
|
if (BlueskyLoadedFeed[CurrentThing + counter].post.labels.length != 0) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue