Facebook video share

岁酱吖の 提交于 2019-12-07 18:48:19

问题


I'm trying to share a video via sharer url (https://www.facebook.com/sharer/sharer.php?u=http%3A%2F%2Fsirius.isebox.net%2Fmichal%2Ftest-test-test-test-test-test-test-test-test-test-test-test-test-test-test-test-test-test-test-test-test-test-test-test%3Fdefault%3Dg5s3e2)

I can't get the video to play in facebook. When I debug using FB's open graph debugger, I get this strange error:

"Share has playable media but will not play inline because it would cause a mixed content warning if embedded. Add a secure_src or make the video src secure to fix this."

I have no idea where to add the secure_src to the header. Notice that og:video:secure_url is already present

Thanks


回答1:


This is working now, honestly I have no idea why it wouldn't work before. Here's my bit of meta goodness that works:

<meta property="og:video:url" content="http://domain.tld/flv.flv">
<meta property="og:video:secure_url" content="https://domain.tld/flv.flv">
<meta property="og:video:width" content="200" />
<meta property="og:video:height" content="300" />
<meta property="og:video:type" content="application/x-shockwave-flash" />

<meta property="og:video:url" content="http://domain.tld/mp4.mp4">
<meta property="og:video:secure_url" content="https://domain.tld/mp4.mp4">
<meta property="og:video:width" content="200" />
<meta property="og:video:height" content="200" />
<meta property="og:video:type" content="video/mp4" />

<meta property="og:video:url" content="http://domain.tld/mp4.mp4">
<meta property="og:video:secure_url" content="https://domain.tld//mp4.mp4">
<meta property="og:video:width" content="200" />
<meta property="og:video:height" content="200" />
<meta property="og:video:type" content="text/html" />



回答2:


You should load the video over HTTPS protocol, the mixed content warning means that your video is loading via HTTP. You can provide your video using two url tags (secure and non-secure).



来源:https://stackoverflow.com/questions/27525006/facebook-video-share

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!