Update social media sharing to use dynamic URLs and images

Update client/index.html and client/src/pages/VideoPage.tsx to dynamically set social media meta tags (og:url, og:image, twitter:image) to the current domain and video-specific thumbnails, resolving issues with incorrect sharing previews.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 2cd2c0bc-434c-4bc9-ad3f-b99d3897a0d1
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/8cc42625-c1f5-4e43-99bd-77f2c4dedee2/2cd2c0bc-434c-4bc9-ad3f-b99d3897a0d1/OdlP8Wj
This commit is contained in:
sebastjanartic
2025-09-03 10:51:32 +00:00
parent 3ade22e7a1
commit 78ff5e47f8
2 changed files with 20 additions and 6 deletions
+3 -2
View File
@@ -180,9 +180,10 @@ export default function VideoPage() {
: `Schauen Sie sich "${currentVideo.title}" auf go4.video an. Professionelle Video-Streaming-Plattform mit exklusivem Content von FOLX STADL, Geschichte des Liedes und weiteren Premium-Inhalten.`;
updateMetaTag('og:description', richDescription);
// Uporabljan cache-busting parameter za social media refresh
// Get the correct domain dynamically and add cache-busting
const timestamp = new Date().getTime();
const socialThumbnail = `${window.location.origin}/api/video-thumbnail/${currentVideo.id}?v=${timestamp}`;
const currentDomain = window.location.origin;
const socialThumbnail = `${currentDomain}/api/video-thumbnail/${currentVideo.id}?v=${timestamp}`;
updateMetaTag('og:image', socialThumbnail);
updateMetaTag('og:image:width', '1200');
updateMetaTag('og:image:height', '630');