fix: Embed player UI, stats loading, and share URL

- Remove black background from embed video to allow transparency
- Update "Watch on Bitvid" button to "Watch on" + white logo
- Fix share URL generation to point to main site instead of embed
- Ensure view counts and reactions are subscribed in embed mode
This commit is contained in:
google-labs-jules[bot] committed 2026-01-24 23:02:33 +00:00
1 parent a8f924a583
commit 9287f91fc1
3 files changed
+28 -3

No files matched your search

+11
View File
@@ -4923,8 +4923,19 @@ class Application {
}
getShareUrlBase() {
if (typeof BITVID_WEBSITE_URL === "string" && BITVID_WEBSITE_URL) {
// Ensure no trailing slash for consistency if desired, though buildShareUrlFromNevent
// appends ?v=... so trailing slash is fine if URL ctor handles it.
// BITVID_WEBSITE_URL usually has a trailing slash in config, but let's be safe.
return BITVID_WEBSITE_URL.replace(/\/$/, "");
}
try {
const current = new URL(window.location.href);
// If we are in the embed, we want to strip that filename.
if (current.pathname.endsWith("/embed.html")) {
return `${current.origin}${current.pathname.replace(/\/embed\.html$/, "")}`;
}
return `${current.origin}${current.pathname}`;
} catch (err) {
const origin = window.location?.origin || "";
+14
View File
@@ -323,6 +323,20 @@ const setPointerState = ({ video, hint } = {}) => {
app.currentVideo.pointer = app.currentVideoPointer;
app.currentVideo.pointerKey = app.currentVideoPointerKey;
}
// Ensure stats subscriptions are active since we don't go through playVideoByEventId
if (app.subscribeModalViewCount) {
app.subscribeModalViewCount(
app.currentVideoPointer,
app.currentVideoPointerKey
);
}
if (app.reactionController && app.reactionController.subscribe) {
app.reactionController.subscribe(
app.currentVideoPointer,
app.currentVideoPointerKey
);
}
};
const startEmbed = async () => {