[Plugin: WPBook] Embedding Videos Via Post Link's Open Graph Metadata
-
Usually when I had a link (example link below) to Facebook from my site ComeWatchMe.com, it plays directly on Facebook the same way a YouTube video would via Facebook’s Open Graph Protocol.
https://www.comewatchme.com/man-exclusive-nba-clip
How comes when WPbook adds a post to Facebook via the “Publish as Links” feature it doesn’t read the Facebook open graph metadata for videos provided by my site? It only grabs a thumbnail.
Below is the open graph data in the header of ComeWatchMe.com
<?php if (get_post_meta($post->ID,'Video',true)) { ?> <meta property="og:title" content="<?php echo get_the_title(); ?>" /> <meta property="og:description" content="<?php global $post; if (is_single()) { echo get_the_excerpt($post->ID); } ?>" /> <meta property="og:image" content="<?php if (get_post_meta($post->ID, Thumbnail)) { ?><?php echo get_post_meta($post->ID, Thumbnail, true); ?><?php } ?><?php $image_id = get_post_thumbnail_id(); $image_url = wp_get_attachment_image_src($image_id,'large'); $image_url = $image_url[0]; ?><?php echo $image_url;?>" /> <meta property="og:video" content="https://www.comewatchme.com/embed/player.swf?file=<?php echo get_post_meta($post->ID, Video, true); ?>&image=<?php if (get_post_meta($post->ID, Thumbnail)) { ?><?php echo get_post_meta($post->ID, Thumbnail, true); ?><?php } ?><?php $image_id = get_post_thumbnail_id(); $image_url = wp_get_attachment_image_src($image_id,'large'); $image_url = $image_url[0]; ?><?php echo $image_url;?>&provider=<?php echo get_post_meta($post->ID, provider, true); ?><?php if (get_post_meta($post->ID,'hd_video_url',true)) { ?>hd-1&hd.file=<?php echo get_post_meta($post->ID, hd_video_url, true); ?><?php } ?>&config=https://www.comewatchme.com/wp-content/themes/comewatchme/facebook-config.php&logo.link=<?php the_permalink() ?>"/> <meta property="og:site_name" content="ComeWatchMe.com"/> <meta property="og:url" content="<?php echo get_permalink(); ?>"/> <meta property="og:type" content="website"/> <?php } ?>
How can I have it grab the video metadata?
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘[Plugin: WPBook] Embedding Videos Via Post Link's Open Graph Metadata’ is closed to new replies.