The Most Popular Extension Builder for Magento 2

With a big catalog of 224+ extensions for your online store

How to upload Product Videos in Magento 2 - Youtube API Key

Are you wondering how to attract and persuade customers more effectively? The answer is, show them, don’t tell them. To help your products be more attractive and lively, Magento 2 allows uploading individual video for any product you need. Videos comprise all kinds of medium, from images to audios, hence being a powerful method to convey any messages. That is why watching Magento product video will bring a true overview of your product to customers before purchasing. The more visual a product is, the more sales is created by the clients.

The video can be uploaded from your browse or you can embed the Youtube link to the product settings. To do that, you must get an API Key from your Google account and insert it in the configuration.

The required steps you should follow are listed clearly in this tutorial.

3 Steps to Upload Product Videos in Magento 2

Step 1: Get Your YouTube API Key

First, you have to get your YouTube API Key by going to your Google account:

  • Log in to your Google account, and visit the Google Developers Console. Then, follow these:
    • Under Use Google APIs, click Youtube Data APIs. google api
    • Click on Manage manage
    • In the panel on the left choose Credentials, click on Create Credentials and choose API key. create
    • When prompted to create a new key, choose Server key. Enter a name for the key and IP address, and click on Create.
  • After you get the key, copy the key to the clipboard. youtube key

Step 2: Configure in Magento

Now, come back to the Magento and finish the settings:

  • On the Admin Sidebar, Stores > Settings > Configuration.
  • In the panel, under Catalog, choose Catalog.
  • Expand the Product Videos section, paste Youtube API key into the required field.

How to upload Product Videos Add API key

  • Click Save Config.
  • Go to Cache Management to refresh the cache.

Add the video on your site and everything will be set!

  • From the Product Detail, click on Add Video in the Images and Videos.

How to upload Product Videos Add Video

  • Enter the URL of the YouTube or Vimeo video. In the URL field, if you haven’t entered the Youtube API key yet, the system error message will appear, click on OK to continue.

How to upload Product Videos Error Message

  • Enter the Title and Description of the video.
  • To upload a Preview Image, browse to the image and select the file.
  • If you prefer to use the video meta data, click on Get Video Information.
  • To assign the role to the video, mark the corresponding checkbox of each Role:
    • Base Image
    • Small Image
    • Swatch Image
    • Thumbnail
    • Hide from Product Page
  • When complete, click on Save.

How to upload Product Videos Product Video

Options for Magento 2 Product Video Configurations

You can adjust various product video choices in the config.xml setup file. You can modify these settings within your custom module’s file.

Option Default Settings What this option offers Types
play_if_base Videos are not played on the page load Videos are played automatically on the page load Boolean
show-related Related videos are not shown Admin can show related videos Boolean
video-auto-restart Videos are not automatically replayed Videos are replayed automatically Boolean
## Issues with Magento 2 Product Video If you're not very familiar with technical tasks as an admin user, you might encounter some challenges when setting up product videos. For instance, you might encounter a message like: *Could not get preview image information. Please check your connection and try again.* This could indicate that certain settings have been configured incorrectly. Therefore, if you've linked to a YouTube video, attempt to only use the YouTube ID (which is shown after "v=" in the URL). ## Final words It’s easy, isn’t it? Creating a product video is more effective than thousands of pictures you show on the product page, thanks to the display of nonverbal communication, especially in today’s digital age and quick pace of life. We and your customers can’t wait to see your videos, so add them now! Feel free to send us the results or share any thoughts on this! ## FAQs: **1. I wanted to add youtube videos to my products but the Field YouTube API Key is greyed out (disabled). And I can't figure out why.** Have you ever executed the config dump command on your installation? If so, you should find a file named config.php in the /app/etc directory. If you observe the configuration variables below in that file, it indicates that you or someone on your team has performed this action. Furthermore, have you already chosen a store from the dropdown menu at the top left? Please verify and choose "Default," then try again. **2. What video format does Magento 2 use?** You can add multiple video formats such as (FLV, MPEG, MP4, etc.) or embed videos from popular platforms such as YouTube and Vimeo. **3. What is the maximum file size for Magento 2 import?** In Magento 2, the maximum default size for an import file is 2 megabytes. To accurately update the file, it is essential to have a thorough understanding of the column descriptions in the CSV file structure. The "sku" serves as an identifier used as a key product attribute in the Magento 2 core. **Related Topics:** - [How to Create Product Attribute Sets]( - [How to Change Welcome Message]( - [How to change Email Logo]( - [How to Enable Customer Login/Register Captcha](
Image Description
Hello, I'm the Chief Technology Officer of Mageplaza, and I am thrilled to share my story with you. My deep love and passion for technology have fueled my journey as a professional coder and an ultra-marathon runner. Over the past decade, I have accumulated extensive experience and honed my expertise in PHP development.

Looking for
Customization & Development Services?

8+ years of experiences in e-commerce & Magento has prepared us for any challenges, so that we can lead you to your success.

Get free consultant
development service

    Explore Our Products:

    People also searched for


    Stay in the know

    Get special offers on the latest news from Mageplaza.

    Earn $10 in reward now!

    Earn $10 in reward now!

    go up