问题
I have a website that has a HTML5 video player.
I want to share the link ( ex: http://site.com/video/example-2 ) on facebook and one the users click on the image of that post on the facebook it starts playing the video there.
Just like youtube videos and vimeo videos.
How can I do that?
Thanks
回答1:
I have a website that has a HTML5 video player.
You want to find a good SWF (*.SWF) video player that can stream video from url={video_Hot_link}
(pass URL
parameter to the SWF
player)
Now after you got your SWF player ready for streaming some videos add Facebook Open Graph
to your <head>
tag like below:
<meta property="og:type" content="video"> <!-- site/page type more information http://ogp.me/ -->
<meta property="og:video:type" content="application/x-shockwave-flash"> <!-- you need this because your player is a SWF player -->
<meta property="og:video:width" content="Width in Pixels"> <!-- player width -->
<meta property="og:video:height" content="Height in Pixels"> <!-- player height -->
<meta property="og:video" content="http://example.com/{path_to}/{swf_player}.swf?url={video_soure}"> <!-- You will need to echo/print the video source (*.mp4) with server-side code -->
<meta property="og:video:secure_url" content="https://example.com/{path_to}/{swf_player}.swf?url={video_soure}"> <!-- required for users whom use SSL (actually Facebook forces everyone to use SSL so you're required to use og:video:secure_url) so get a one -->
Additionally, you need to add the following prefix to <html>
likeso
<html prefix="og: http://ogp.me/ns#">
回答2:
Facebook no longer permits inline playback for third party players. Vimeo even mentions this in their documentation.
Moving forward you will need to use Facebook's own video hosting platform if you want to have videos play inline in the newsfeed.
回答3:
I also used og:video to share video but on debugging it on https://developers.facebook.com/tools/debug/og/object/ , it gives warning error The 'og:image' property should be explicitly provided, even if a value can be inferred from other tags.
来源:https://stackoverflow.com/questions/18903547/how-to-share-a-video-from-my-website-on-facebook-like-youtube