Skip to main content

ExternalVideo
component

The ExternalVideo component renders an embedded video for the Storefront API's ExternalVideo object.

Takes in the same props as a native <iframe> element, except for src.

PartialDeep<ExternalVideoType, {recurseIntoArrays: true}>
required

An object with fields that correspond to the Storefront API's ExternalVideo object.

|

An object containing the options available for either YouTube or Vimeo.

Was this section helpful?

ExternalVideo example

import {ExternalVideo} from '@shopify/hydrogen-react';

export default function MyProductVideo({products}) {
const firstMediaElement = products.nodes[0].media.nodes[0];

if (firstMediaElement.__typename === 'ExternalVideo') {
return <ExternalVideo data={firstMediaElement} />;
}
}