Page 1 of 1

get facebook share to share correct video image

Posted: Sat Sep 01, 2012 11:23 pm
by jonathan76
i have a facebook share on a website i have created for a client and it is to share a youtube video.

I use youtubeplayer to embed the videos and a special template to play the videos that displays the vodeo in the page with a random list on the right hand side.

The proble is i have managed to get the facebook share to share the correct video title and video link but it refuses to share the correct video image/thumb.

i have been at this now for 2 weeks and nothing i do seems to work can anybody help?

Thanks in advance.

Re: get facebook share to share correct video image

Posted: Sun Sep 02, 2012 4:58 pm
by carasmo
Got a link? I use Facebook Open graph and assign the thumb from the video and then use that in the open graph settings for the image
Some links on Open Graph:

https://developers.facebook.com/tools/debug
https://developers.facebook.com/docs/op ... yconcepts/
http://dropsoul.com/blog/33/How-to-find ... ok-ID.html

This number is used in the fb:admins content results below.

Code: Select all

{if isset($pagetitle)} {*this is specific for cgblog and or news with this assignment in the top of the detail page, you would create this or use a separate template that has your open graph stuff in the head*}
<!-- Open Graph for facebook
================================================== -->
	<meta property="og:title" content="{$pagetitle}" />
	<meta property="og:type" content="website" />
	<meta property="og:url" content="{$canonical}" />
	<meta property="og:image" content="{$facebook}"/>
	<meta property="og:site_name" content="brief description" />
	<meta property="fb:admins" content="XXXX" /> {*put your fb admin number in here*}
	<meta property="og:locale" content="en_us" />
	<meta property="og:description" content="{$meta_desc}" />
{/if}
I've also assigned a field that grabs the description from the post in CGblog, you can do this with a regular page, just use the content block or the another block and assign that.

{*meta description used in the fb open graph used in the CGBlog*}
{assign var='meta_desc' value=$entry->content|truncate:'250'|strip_tags|strip}


Make sure the thumb you call is at least 200 px wide.

Re: get facebook share to share correct video image

Posted: Sun Sep 02, 2012 5:05 pm
by carasmo
The youtube image you call needs to be at least 200 pix wide

Code: Select all

http://img.youtube.com/vi/{$entry->fieldsbyname.youtube->value}/0.jpg
This is an example using cgblog with a custom field called youtube that you only put the id of the video in.

I also have one for vimeo, lemme know.

Re: get facebook share to share correct video image

Posted: Sun Sep 02, 2012 6:55 pm
by jonathan76
the link is:
jollex.com if you go to view a video the share button is bellow the video i have to fix the layout at present but the basics of everything else works.

It shres all the correct data except the video thumb/image.

Thanks for your help

Re: get facebook share to share correct video image

Posted: Sun Sep 02, 2012 11:01 pm
by carasmo
It would be impossible to get the thumb of the video since it's not on the page. The embed of a video doesn't bring in the associated thumbs. There's other images that fit the criteria that are on the page, so it's going to grab whatever and it cycles through them too.

Bring in the thumb onto the page and then capture it, stick it in the open graph stuff since that will make sure that it's the default image.

Here's what the thumb is for the seagulls love donuts or something:
http://img.youtube.com/vi/_q4ewCCBAm4/0.jpg

Re: get facebook share to share correct video image

Posted: Mon Sep 03, 2012 1:04 pm
by jonathan76
Thanks carasmo,
I got it to work as you pointed me in the right direction it was kinda simple really now that i think of it.

all i had to do was as you say pull in the image in a hidden div near the actual video and it worked.

Thanks for your help.

jonathan ;D ;D ;D ;D

Re: get facebook share to share correct video image

Posted: Mon Sep 03, 2012 1:07 pm
by jonathan76
My client also wants a ratings system say star ratings attached to youtubeplayer videos i have been trying to do this but get totally frustrated as it does not work.

Jonathan

Re: get facebook share to share correct video image

Posted: Tue Sep 04, 2012 9:05 pm
by Dr.CSS
The last post should have been a separate post, but...

Did you put the call for the ratings in the detail template of youtube player..?

Re: get facebook share to share correct video image

Posted: Wed Sep 05, 2012 8:12 am
by jonathan76
Thanks for reply sorry i should have put it in another post my bad.

i tried to do this using the youtube player detail template but it does not save the data it just displays the same rating for all videos.

Re: get facebook share to share correct video image

Posted: Thu Sep 06, 2012 1:08 am
by Dr.CSS
Now the question is, what module are you using, what does the modules tag look like that you are using..?

Re: get facebook share to share correct video image

Posted: Sun Sep 09, 2012 9:05 pm
by jonathan76
I wastrying to use cg feedback module to allow ratings of youtubeplayer videos.