Improve video sharing by using custom thumbnails when available
Update `client/src/pages/VideoPage.tsx` to prioritize `customThumbnailUrl` over `thumbnailUrl` for Open Graph and Twitter meta tags, enhancing social sharing previews. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 074b0e4c-6171-43bd-aa98-f9e04623ca14 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/8cc42625-c1f5-4e43-99bd-77f2c4dedee2/074b0e4c-6171-43bd-aa98-f9e04623ca14/Sy6XHzr
This commit is contained in:
parent
4b415de2c9
commit
1066402619
@ -95,7 +95,9 @@ export default function VideoPage() {
|
|||||||
|
|
||||||
updateMetaTag('og:title', currentVideo.title);
|
updateMetaTag('og:title', currentVideo.title);
|
||||||
updateMetaTag('og:description', currentVideo.description || `Watch ${currentVideo.title} on go4.video`);
|
updateMetaTag('og:description', currentVideo.description || `Watch ${currentVideo.title} on go4.video`);
|
||||||
updateMetaTag('og:image', currentVideo.thumbnailUrl);
|
// Use custom thumbnail if available, otherwise default thumbnail
|
||||||
|
const thumbnailForSharing = currentVideo.customThumbnailUrl || currentVideo.thumbnailUrl;
|
||||||
|
updateMetaTag('og:image', thumbnailForSharing);
|
||||||
updateMetaTag('og:url', window.location.href);
|
updateMetaTag('og:url', window.location.href);
|
||||||
updateMetaTag('og:type', 'video.other');
|
updateMetaTag('og:type', 'video.other');
|
||||||
updateMetaTag('og:video:duration', currentVideo.duration.toString());
|
updateMetaTag('og:video:duration', currentVideo.duration.toString());
|
||||||
@ -113,7 +115,7 @@ export default function VideoPage() {
|
|||||||
|
|
||||||
updateTwitterTag('twitter:title', currentVideo.title);
|
updateTwitterTag('twitter:title', currentVideo.title);
|
||||||
updateTwitterTag('twitter:description', currentVideo.description || `Watch ${currentVideo.title} on go4.video`);
|
updateTwitterTag('twitter:description', currentVideo.description || `Watch ${currentVideo.title} on go4.video`);
|
||||||
updateTwitterTag('twitter:image', currentVideo.thumbnailUrl);
|
updateTwitterTag('twitter:image', thumbnailForSharing);
|
||||||
}
|
}
|
||||||
}, [currentVideo]);
|
}, [currentVideo]);
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user