Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
general-topic
SEO - Embedded video thumbnails
Avatar
Emmet Brown
Member
sp_UserOfflineSmall Offline
Apr 8, 2016 - 1:54 am

I would really love to be able to tweet and facebook a topic and have the thumbnail of the first embedded video in the post show up in the twitter card or the facebook post.

The only way I've been able to get this done so far is to manually edit the /forum/ page and put the thumbnail there temporarily while I create the twitter and facebook posts.

Is there a better way to accomplish this?

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Apr 8, 2016 - 4:33 am

I probably can't answer but I can get some information to help someone who can!
So the first question - how do you send this to FB? Are you using our Share This plugin?

andy-signature.png
YELLOW
SWORDFISH
Avatar
Emmet Brown
Member
sp_UserOfflineSmall Offline
Apr 9, 2016 - 12:05 am

Yes.

Actually share this plugin works perfectly if there is an image attached somewhere in the topic.  It picks out the first image and uses that.  If there's no image, it pulls the featured image that is set for the forum.  This is working as one would expect.

However if the user pastes in a link from vimeo or something, video is automatically embeded as per WP oembed (I think), but no image is pulled by share this.

My workaround is to manually create an image from the video and edit the users post and attach the image to his/her post.  Share this then grabs that attached image.

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Apr 9, 2016 - 4:42 am

At the moment - without advice - I am just speculating, but could this be because a WP embedded video is actually sourced in an iFrame and targets like Facebook are, in all probability, going to deny creating an iFrame simply because of the potential security risk?

andy-signature.png
YELLOW
SWORDFISH
Avatar
Emmet Brown
Member
sp_UserOfflineSmall Offline
Apr 9, 2016 - 4:36 pm

Well, my understanding of the way Facebook et al. work is that they go to the provided link and "scrape" the meta data from the page.  In that meta data are a bunch of tags.  Tags are things like og:title="My web page" where og stands for "open graph" (facebook's defined standard set of tags).

So we want the tags to be right before facebook scrapes the page and I think simplepress SEO or maybe the Sharethis plugin are the things that set those tags up.

The tag we are mainly concerned with is "og:image"  (open graph image). I can see the og:image tag being set to the first attached image in the topic if one exsists, and failing that it is set to the feature image for the forum - this is working.  But if I put in a vimeo video link as the first post, the og:image tag isn't affected.  Essentially it is only grabbing attached images, and not doing anything with embedded video.

What I'd like is for the software to set the og:image tag to the video thumbnail. 

This may be more of a feature request than a bug, but I think it would REALLY improve the ability to share posts on social media.

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Apr 9, 2016 - 6:24 pm

yes, you have the general idea of how open graph tags works... and how we have implemented what you speak of...

not familiar at all with vimeo other than having heard of it, how would one get a video thumbnail given an embedded url to the video?

and definitely a feature request... which we could always add to our list if we understand the concept...  how would it work with non vimeo videos?  vimeo is far from the most common video and would be best to support the masses vice a single one...

Avatar
Emmet Brown
Member
sp_UserOfflineSmall Offline
Apr 9, 2016 - 6:26 pm

Let me do the research on this.  I will post back here with a method that I think will work.

I think the two most popular video hosts would be youtube and vimeo.  I'll work on methods for both.

Avatar
Emmet Brown
Member
sp_UserOfflineSmall Offline
Apr 9, 2016 - 6:35 pm

Youtube:

There are a predictable set of urls outlined in the refence link below but generally go something like this:

http://img.youtube.com/vi/<insert-youtube-video-id-here>/0.jpg

 

Reference:

http://stackoverflow.com/quest.....outube-api

Avatar
Emmet Brown
Member
sp_UserOfflineSmall Offline
Apr 9, 2016 - 6:41 pm

Vimeo:

Similarly, a predictable url:

"http://vimeo.com/api/v2/video/.php"

But you have to either parse the file or just deserialize as outlined in the reference below like this:

 

Reference:

https://arjunphp.com/how-to-ge.....-video-id/

Avatar
Emmet Brown
Member
sp_UserOfflineSmall Offline
Apr 9, 2016 - 6:46 pm

Emmet Brown said
Vimeo:

Similarly, a predictable url:

"http://vimeo.com/api/v2/video/<video id>.php"

But you have to either parse the file or just deserialize as outlined in the reference below like this:

 

Reference:

https://arjunphp.com/how-to-ge.....-video-id/

Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 619
Members: 17362
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10127
Posts: 79625