mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-27 07:52:24 +00:00
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:
1 parent
a8f924a583
commit
9287f91fc1
3 files changed
+28
-3
No files matched your search
+3
-3
@@ -79,7 +79,7 @@
|
||||
>
|
||||
<video
|
||||
id="embedVideo"
|
||||
class="h-full w-full object-contain bg-black"
|
||||
class="h-full w-full object-contain"
|
||||
controls
|
||||
playsinline
|
||||
preload="metadata"
|
||||
@@ -97,12 +97,12 @@
|
||||
target="_blank"
|
||||
class="flex items-center gap-2 rounded-full border border-white/20 bg-white/10 px-3 py-1.5 text-xs font-medium text-white transition-colors hover:bg-white/20 backdrop-blur-md"
|
||||
>
|
||||
<span>Watch on</span>
|
||||
<img
|
||||
src="assets/svg/bitvid-logo-light-mode.svg"
|
||||
alt="BitVid"
|
||||
class="h-4 w-auto"
|
||||
class="h-4 w-auto invert brightness-0"
|
||||
/>
|
||||
<span>Watch on BitVid</span>
|
||||
</a>
|
||||
|
||||
<div
|
||||
|
||||
@@ -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
@@ -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 () => {
|
||||
|
||||
Reference in new issue
Block a user