Add automatic Facebook sharing with video previews
Implement server-side Open Graph meta tags for videos and update video sharing functionality. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 401e2ec0-e00d-4f10-9d0e-60f3d479f9a5 Replit-Commit-Checkpoint-Type: intermediate_checkpoint Replit-Commit-Event-Id: 3500eb91-6967-423b-a9b5-22b380def61b Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/60d372ff-2c10-46c7-b01b-10c3435136b0/401e2ec0-e00d-4f10-9d0e-60f3d479f9a5/lPVBpdc
This commit is contained in:
@@ -315,6 +315,13 @@ export default function VideoPage() {
|
||||
return `${baseUrl}/video/${currentVideo.id}`;
|
||||
};
|
||||
|
||||
// Facebook share URL uses special endpoint with proper OG meta tags
|
||||
const getFacebookShareUrl = () => {
|
||||
if (!currentVideo?.id) return window.location.origin;
|
||||
const baseUrl = 'https://video.folx.tv';
|
||||
return `${baseUrl}/share/video/${currentVideo.id}`;
|
||||
};
|
||||
|
||||
const copyToClipboard = async () => {
|
||||
try {
|
||||
await navigator.clipboard.writeText(getShareUrl());
|
||||
@@ -732,7 +739,7 @@ export default function VideoPage() {
|
||||
|
||||
{showShareMenu && (
|
||||
<div className="absolute right-0 top-full mt-2 bg-gray-800 rounded-lg shadow-lg py-2 z-50 min-w-[200px]">
|
||||
<FacebookShareButton url={getShareUrl()}>
|
||||
<FacebookShareButton url={getFacebookShareUrl()}>
|
||||
<div className="w-full px-4 py-2 text-left text-white hover:bg-gray-700 flex items-center gap-2 cursor-pointer">
|
||||
<FacebookIcon size={16} round />
|
||||
Facebook
|
||||
|
||||
Reference in New Issue
Block a user