Skip to main content

<IFrame>

<IFrame /> 可以像普通的 <iframe> HTML 标签一样使用。

🌐 The <IFrame /> can be used like the regular <iframe> HTML tag.

Remotion 会自动将 <iframe> 封装在 delayRender() 调用中,并确保在渲染帧之前 iframe 已加载。

🌐 Remotion automatically wraps the <iframe> in a delayRender() call and ensures that the iframe is loaded before rendering the frame.

理想情况下,网站不应有任何动画,因为 Remotion 仅支持使用 useCurrentFrame() 的动画。有关解释,请参见 Flickering

🌐 Ideally, the website should not have any animations, since only animations using useCurrentFrame() are supported by Remotion. See Flickering for an explanation.

示例

🌐 Example

import {IFrame} from 'remotion';

export const MyComp: React.FC = () => {
  return <IFrame src="https://remotion.dev" />;
};

属性

🌐 Props

src

要加载的 URL。

🌐 The URL to load.

delayRenderTimeoutInMillisecondsv4.0.140

自定义此组件进行的 delayRender() 调用的 超时 设置。

🌐 Customize the timeout of the delayRender() call that this component makes.

delayRenderRetriesv4.0.140

自定义此组件进行的 delayRender() 调用的 重试次数。 优先使用 maxRetries 属性而不是这个。

🌐 Customize the number of retries of the delayRender() call that this component makes.
Prefer the maxRetries prop over this.

兼容性

🌐 Compatibility

BrowsersEnvironments
Chrome
Firefox
Safari

另请参阅

🌐 See also