PHP 7.3 reached end of support in December 2021 and Adobe Commerce 2.3.x reaches end of support in September 2022. You may want to consider planning your upgrade now to Adobe Commerce 2.4.x and PHP 7.4.x to help maintain PCI compliance.

Configure product video

What’s in this topic

In Magento 2 on product pages you can add video from external resources (currently, from YouTube and Vimeo). Video is added in Admin when creating or editing a product. Certain product video options can be set in the config.xml configuration file. These settings are not theme-specific.

Configure product video options

You can set the following product video options:

Option Description Type Default
play_if_base Play automatically on page load. Boolean 0
(video is not played on page load)
show_related Display related videos. Boolean 0
(related videos are not displayed)
video_auto_restart Auto re-play video. Boolean 0
(video is not automatically replayed)

You can configure these options in your custom module’s config.xml file.


<config xmlns:xsi="" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd">

For the sake of compatibility, upgradability and easy maintenance, do not edit the default Magento code. Instead add your customizations in a separate module.

Configure product video options from Admin

  1. On the Admin sidebar, go to Stores > Settings > Configuration.

  2. In the left panel, expand Catalog and choose Catalog underneath.

  3. Expand the Product Video section and uncheck the Use system value checkbox. Then change the configuration options.

Product Video Options

  1. When complete, click Save Config.

  2. When prompted, refresh the cache.