我按照https://developers.facebook.com/docs/instant-articles/reference/social上的说明操作 相关的 https://developers.facebook.com/docs/plugins/embedded-posts#add-code-manually 在即时文章中嵌入Facebook视频。这是我为嵌入而得到的结果,但不幸的是,当我预览页面时,我得到一个简短的灰色闪光,视频应该是,然后没有视频。
<!-- Article body goes here --><figure class="op-social">
<iframe>
<!-- Include Facebook embed code here. Your Facebook embed code should contain both the "JavaScript SDK" and the "Embedded Post Tag" parts described at https://developers.facebook.com/docs/plugins/embedded-posts#add-code-manually -->
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src ="//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.6&appId=906632809405090";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<div class="fb-post" data-href="https://www.facebook.com/PopSugarCelebrity/videos/10154334075529824/0506729/" data-width="300" data-show-text="true"></div>
</iframe>
</figure>
<p>Ernestine Shepherd, one of the world's oldest bodybuilders, turned 80 this month—and she's making us all want to hit the gym. While we're not about to join her for 3 a.m. workouts or 10-mile runs (did we mention she's a badass?), Shepherd's story is a great reminder that it's never too late to adopt healthy habits. She didn't start exercising until she was 56! </p>
我已成功将youtube,twitter和Instagram嵌入到我们的各种FBIA页面中,所以我认为fb视频应该很快,但没有这样的运气。有没有成功在FBIA页面上嵌入FB视频的人有一些关于上述代码出错的提示?
答案 0 :(得分:2)
我使用FB's configurator中的iframe嵌入代码取得了成功。该工具可让您选择“iFrame”代码段(位于顶部)。
以下是iframe嵌入的示例,该嵌入可用于即时文章标记(请务必更新URL和AppID)。
<figure class="op-interactive">
<iframe src="https://www.facebook.com/plugins/video.php?href=https%3A%2F%2Fwww.facebook.com%2Ffacebook%2Fvideos%2F10153231379946729%2F&width=500&show_text=false&appId=906632809405090&height=281" width="500" height="281" style="border:none;overflow:hidden" scrolling="no" frameborder="0" allowTransparency="true"></iframe>
</figure>