How to Add Magento 2 Product Video

The purpose behind it is to satisfy customers by providing them with a more detailed product description. Videos on a product page is a great way to share details and making the product page more attractive. Not only that, you can also use your product video for promotional activities.

You can easily add Magento 2 product videos which can help inform your customers about your products in a better way.

Steps for Adding Magento 2 Product Video

  1. Generate a Youtube API Key
  2. Integration of the Youtube API key into Magento 2
  3. Implementation of Magento 2 Product Video

Generate a YouTube API Key

To add product video, you must first obtain an API Key from your Google account and enter it in the configuration of your store. Then, you can link to the video from the product.

Here are the steps for this-

  1. Log in to your Google account and visit theΒ Google Developers Console.

 

  1. In the Search field at the top, enterΒ YouTube Data API v3 and click the search icon and click onΒ YouTube Data API v3 .

 

  1. When the API page is displayed, make sure it is enabled.

 

  1. In the left panel, chooseΒ Credentials.

 

  1. Depending on whether you have credentials or not, do one of the following:
    • If you already have the needed credentials, copy the key in theΒ API keysΒ table.
    • If you do not already have credentials for this API, clickΒ Create CredentialsΒ at the top and follow the prompts to create the needed credentials. UnderΒ Get your credentials, copy the API key and clickΒ Done.
  2. Copy the API key to the clipboard.

 

  1. Click the Edit icon on the right and set the restrictions to make sure the API key is limited to the correct referrers.
  2. Wait a few moments while the key is generated and then copy the key to the clipboard.In the next step, you will paste the key into your store’s configuration.

Integration of Youtube API key to Magento 2

Go to the Admin Panel of your Magento Store and navigate to theΒ STORESΒ tab from the left corner of the page. SelectΒ ConfigurationΒ from the options.

 

Now click onΒ CatalogΒ underΒ CATALOG:

 

Go toΒ Product VideoΒ section and insert theΒ Youtube API keyΒ which you generated in Google Developers Console. Then click onΒ Save Config.

 

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)

Integrate Magento 2 Product Video

Go to the Admin Panel of the Magento 2 Store and navigate to theΒ CATALOGΒ Β tab. Next, click theΒ ProductsΒ option.

 

Click on theΒ EditΒ option of product.

 

Now go to theΒ Images and VideosΒ section of Product and click onΒ Add Video.

 

Enter theΒ Product video URLΒ from Youtube and click onΒ Save.

 

Now, just click onΒ Save THE PRODUCT.

To watch this video, open this product on the frontend.

The above result means that you have successfully integrated a Magento 2 product video.

Conclusion

You can use the video feature to attract and convince customers about the product. By following this tutorial, you’ll be able to add Magento 2 product videos easily. If you have a problem or would like to add more to the discussion, just leave a comment below.