自适应Facebook嵌入视频 [英] Responsive facebook embed video

查看:193
本文介绍了自适应Facebook嵌入视频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要使Facebook视频嵌入响应,因为Facebook具有固定大小,但是它不适合屏幕大小。

I need to make a facebook video embed responsive, since facebook has a "fixed" size, however it does not adapt to the size of the screen.

何时我将 auto设置为facebook的宽度,具体取决于视频显示的高度比正常情况大得多,如下所示(将高度设为1100,正常值为770)

When I put "auto" in the width of facebook, depending on the video it leaves the height much larger than normal, as shown below (leaves the height at 1100, being normal of it is 770)

https://developers.facebook.com/docs/plugins/embedded-video-player/?prefill_href=https%3A%2F%2Fwww.facebook.com%2Frobertdowneyjr%2Fvideos %2F665148873653581%2F#configurator

由于将包含多个大小不同的视频,因此无法在某些外部div上保持固定大小。

Because multiple videos of different sizes will be included, it is not possible to leave a fixed size on some external div.

推荐答案

现在,Facebook支持嵌入响应视频

Now Facebook supports responsive video embed

<script async defer src="https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v3.2"></script>
<div class="fb-video"
    data-href="https://www.facebook.com/watch/?v=10155278547321729"
    data-width="auto"
    data-show-captions="false">
</div>

这篇关于自适应Facebook嵌入视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆