Cannot play embedded videos on facebook wall unles

2019-05-26 19:51发布

问题:

I am trying to embed (non-You Tube) videos on a Facebook wall so that when the user clicks on them, the video plays on the wall. What's happening is: if the user is not logged in or has SSL disabled, it works. However, if they access the page securely with an "https:" scheme or if they are logged in with SSL enabled, when they click on the video, a new tab is launched with the address of the page where the video resides.

I have researched this problem. The two solutions I have are, updating the OpenGraph metadata on the page and providing an SSL enabled version of the page. I have tried adding og metadata - initially I tried just adding the following:

<meta property="og:video" content="http://example.com/awesome.swf" />
<meta property="og:video:height" content="640" />
<meta property="og:video:width" content="385" />
<meta property="og:video:type" content="application/x-shockwave-flash" />

That didn't work, and the facebook debugger was complaining about a few missing metadata tags, so I added those (type, url, etc.). Now when I run it through the debugger, I don't get any warnings, and it now reports:

When this URL is shared on facebook, it is treated as a certain type. By putting meta tags on this page, you can influence how it is shared. Video status Video embedding on Facebook enabled

I am blocked from proceeding. I can do anything about the SSL until my boss gets back, however, I don't see how that matters, considering the video works properly when SSL is disabled.

回答1:

You need to add a meta tag detailing where the secure URL for your video is:

<meta property="og:video:secure_url" content="https://some/awesome.swf" />

See https://developers.facebook.com/docs/opengraph/ for more info.



回答2:

Note after some testing, The latest behavior for facebook embed with in-wall playback is that both og:video and og:video:secure_url must be https, or if only og:video, have that be https instead of http.