get facebook share to share correct video image

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
jonathan76
Forum Members
Forum Members
Posts: 10
Joined: Wed Aug 08, 2012 9:58 pm

get facebook share to share correct video image

Post 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.
carasmo
Power Poster
Power Poster
Posts: 506
Joined: Thu Feb 08, 2007 6:11 pm

Re: get facebook share to share correct video image

Post 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.
carasmo
Power Poster
Power Poster
Posts: 506
Joined: Thu Feb 08, 2007 6:11 pm

Re: get facebook share to share correct video image

Post 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.
jonathan76
Forum Members
Forum Members
Posts: 10
Joined: Wed Aug 08, 2012 9:58 pm

Re: get facebook share to share correct video image

Post 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
carasmo
Power Poster
Power Poster
Posts: 506
Joined: Thu Feb 08, 2007 6:11 pm

Re: get facebook share to share correct video image

Post 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
jonathan76
Forum Members
Forum Members
Posts: 10
Joined: Wed Aug 08, 2012 9:58 pm

Re: get facebook share to share correct video image

Post 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
jonathan76
Forum Members
Forum Members
Posts: 10
Joined: Wed Aug 08, 2012 9:58 pm

Re: get facebook share to share correct video image

Post 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
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: get facebook share to share correct video image

Post 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..?
jonathan76
Forum Members
Forum Members
Posts: 10
Joined: Wed Aug 08, 2012 9:58 pm

Re: get facebook share to share correct video image

Post 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.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: get facebook share to share correct video image

Post by Dr.CSS »

Now the question is, what module are you using, what does the modules tag look like that you are using..?
jonathan76
Forum Members
Forum Members
Posts: 10
Joined: Wed Aug 08, 2012 9:58 pm

Re: get facebook share to share correct video image

Post by jonathan76 »

I wastrying to use cg feedback module to allow ratings of youtubeplayer videos.
Post Reply

Return to “Modules/Add-Ons”