我希望能够使用不同的视频提供商将我的 WordPress 网站中的视频共享到 Facebook。我能够使用自己的视频播放器,但我还没有准备好使用我的服务器发布视频,我更喜欢让用户使用 youtube、vimeo、facebook 等提供商发布视频......现在我的网站有这些一种视频播放器。我多次编辑元标签,这是我目前拥有的:
<meta name=”medium” content=”medium_type” />
<meta property="og:title" content="<?php the_title(); ?>" />
<meta name="description" content="<?php echo string_limit_words(get_the_excerpt(), 25); ?>" />
<meta property="og:type" content="article" />
<meta property="og:url" content="<?php the_permalink(); ?>" />
<meta property="og:image" content="http://gullypost.com/wp-content/themes/gullypost/images/fbmov.jpg" />
<meta property="og:site_name" content="<?php bloginfo('name'); ?>" />
<meta property="fb:app_id" content="145902762138730" />
<meta property="video_type" content="application/x-shockwave-flash" />
<meta property="video_height" content="360" />
<meta property="video_width" content="640" />
<link rel="image_src" href="<?php echo $wpc_image_url[0] ?>"; } ?>" />
<link rel="videothumbnail" href="<?php if( ( $video_thumbnail = get_video_thumbnail() ) != null ) { echo "<img src='".$video_thumbnail."' />"; } ?>" />
<!-- CALLIN A PLUGIN THAT DOES VIDEO THUMBNAILS, HOPING IT WILL WORK, THIS IS NOT MAKING IT SHOW UP ON MY WALL WITH THUMBNAIL FOR VIDEO -->
<link rel="video_src" href="<?php get_post_meta($post->ID, 'videosource', true); ?>" /> <!-- THIS IS A CUSTOM POST WITH LINK OF SOURCE LIKE YOUTUBE OR VIMEO, BUT IS NOT MAKING IT SHOW UP ON MY WALL -->
我还使用单个 YouTube 视频对其进行了测试,效果很好。但由于除了 YouTube 之外我还有其他视频,因此我无法在仅获得 YouTube ID 的情况下执行此操作。昨天显示了没有视频的帖子,但现在当所有帖子都被分享时,它就会显示出来,就像我墙上的视频一样,所以如果点击它会给出错误。我整个星期都在为此烦恼,但仍然无法让它发挥作用。谁能指出我的问题,或者告诉我该怎么做。我到处搜索,但他们只是解释同样的事情,基本上是针对一名球员。如果你能在这里帮助我,我将不胜感激。
另一件事是......当我更新我的脚本时,Facebook 需要很长时间才能更新更改。我必须等待很长时间才能再次测试它,就像 Facebook 将其保存在缓存中的时间太长一样,有没有办法绕过它?
I want to be able to share videos from my Wordpress site to Facebook using different video providers. I was able to use my own video player, but I'm not ready to post videos using my server and I prefer to have users post using a provider like youtube, vimeo, facebook, ect.... Right now my site has those kind of video players. I edit the meta tags several times, this is the one I currently have:
<meta name=”medium” content=”medium_type” />
<meta property="og:title" content="<?php the_title(); ?>" />
<meta name="description" content="<?php echo string_limit_words(get_the_excerpt(), 25); ?>" />
<meta property="og:type" content="article" />
<meta property="og:url" content="<?php the_permalink(); ?>" />
<meta property="og:image" content="http://gullypost.com/wp-content/themes/gullypost/images/fbmov.jpg" />
<meta property="og:site_name" content="<?php bloginfo('name'); ?>" />
<meta property="fb:app_id" content="145902762138730" />
<meta property="video_type" content="application/x-shockwave-flash" />
<meta property="video_height" content="360" />
<meta property="video_width" content="640" />
<link rel="image_src" href="<?php echo $wpc_image_url[0] ?>"; } ?>" />
<link rel="videothumbnail" href="<?php if( ( $video_thumbnail = get_video_thumbnail() ) != null ) { echo "<img src='".$video_thumbnail."' />"; } ?>" />
<!-- CALLIN A PLUGIN THAT DOES VIDEO THUMBNAILS, HOPING IT WILL WORK, THIS IS NOT MAKING IT SHOW UP ON MY WALL WITH THUMBNAIL FOR VIDEO -->
<link rel="video_src" href="<?php get_post_meta($post->ID, 'videosource', true); ?>" /> <!-- THIS IS A CUSTOM POST WITH LINK OF SOURCE LIKE YOUTUBE OR VIMEO, BUT IS NOT MAKING IT SHOW UP ON MY WALL -->
I also tested it using a single youtube video and it worked fine. But since I have other videos beside youtube I can't do it where it just gets a youtube id. Yesterday the posts without videos were showing up, but now when all posts gets share it shows up like if it was a video on my wall, so if clicked it will give an error. I been pulling my hair all week with this and still couldn't get it to work. Can anybody point me out the problem, or tell me how I should do it. I search everywhere but they just explain the same thing, basically for one player. I'll appreciate it if you can help me out here.
Another thing is... when I update my script, it takes so long for facebook to update the change. I have to wait for so long in order to test it again, like if facebook is holding it in cache for too long, is there a way to bypass that?
发布评论
评论(1)
要显示视频,请使用 og:video 元标记,而不是您现在使用的
代码。 og:video 标记的值应该是 .swf 文件(或将自动转换的 YouTube 链接)。您可以在此处查看视频所需的开放图元标记。
您可以使用URL Linter 调试器工具更新缓存。
To have a video display, use the og:video meta tag instead of the
<link rel"video_src" />
code you are using now. The value of the og:video tag should be a .swf file (or a youtube link which will get automatically converted). You can see the open graph meta tags needed for video here.You can get the cache updated by using the URL Linter Debugger tool.