WordPress.org

Ready to get started?Download WordPress

Forums

WPBook
Embedding Videos Via Post Link's Open Graph Metadata (6 posts)

  1. Chozen
    Member
    Posted 2 years ago #

    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.

    http://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="http://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=http://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?

    http://wordpress.org/extend/plugins/wpbook/

  2. johneckman
    Member
    Plugin Author

    Posted 2 years ago #

    When posting as a link, the only options the Facebook API allows are the link itself and a status message.

    There's no hinting in the API in terms of how to force it to read the right metadata.

    Have you tried the Facebook URL linter?

    http://developers.facebook.com/tools/debug/og/object?q=http%3A%2F%2Fwww.comewatchme.com%2Fman-exclusive-nba-clip

  3. Chozen
    Member
    Posted 2 years ago #

    Yes I do that test with all my sites, the videos plays just fine on Facebook when I actually add the post link my self, but I'm wondering why the same metadata that Facebook reads when I add the link muself, it doesn't get read when added via wpbook.

    The Object Debugger shows all the valid metadata available, so why wouldn't automatically embed the video when the link is posted by wpbook? It's still reading that data from the link provided so why is that metadata being ignored when posted via wpbook?

  4. johneckman
    Member
    Plugin Author

    Posted 2 years ago #

    Honestly not sure. WPBook / WPBook Lite, when publishing as a link, is really only passing to the Facebook API a small amount of information: a 'link' and a 'message.'

    The link is the url (post permalink) and the message is either the excerpt if the post has one or the beginning of the content of the post if the post has no excerpt, with html stripped.

    Looks like this may be a Facebook bug: http://developers.facebook.com/bugs/134107306705941?browse=search_4f58ee1f79e7f7a47287243

  5. Chozen
    Member
    Posted 2 years ago #

    This site called RapDose.com is using WPBook and they're able to pass the embed code to their Facebook page http://www.facebook.com/RapDose

    How did they do it? I sent them an email but I didn't get a response, which is expected - music bloggers aren't into helping each other.

    Any ideas?

  6. johneckman
    Member
    Plugin Author

    Posted 2 years ago #

    No idea. How do you know they're using WPBook?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags