How to integrate product video in magento 2 using youtube

cpujjwal

Member
XNullUser
Joined
Feb 3, 2022
Messages
31
Reaction score
3
Points
8
NullCash
8

Adding Product Video​


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.

Step 1: Get your YouTube API key​

  1. Log in to your Google account and visit the Google Developers Console.
  2. In the Search field at the top, enter YouTube Data API v3 and click the search icon.
  3. When the API page is displayed, make sure it is enabled.
  4. In the left panel, choose Credentials.
  5. 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.
  6. Copy the API key to the clipboard.
  7. Click the Edit icon on the right and set the restrictions to make sure the API key is limited to the correct referrers.
  8. 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.

Step 2: Configure the key in Commerce​

  1. On the Admin sidebar, go to Stores > Settings > Configuration.
  2. In the left panel, expand Catalog and choose Catalog underneath.
  3. Expand
    icon-display-expand.png
    the Product Video section and paste your YouTube API key.
    Product Video
  4. When complete, click Save Config.
  5. When prompted, refresh the cache.

Step 3: Link to the video​

  1. Open a product in edit mode.
  2. In the Images and Video section, click Add Video.
    If you haven’t yet configured your YouTube API key, click OK to continue. You won’t be able to link to a YouTube video, but you can go through the process.
    Add Video
  3. Enter the URL of the YouTube or Vimeo video.
  4. Click outside the field and wait for feedback on the API key or video.
    If everything checks out, Youtube provides base information of the video
  5. Enter the Title and Description of the video.
  6. To upload a Preview Image, browse to the image and select the file.
  7. If you prefer to use the video meta data, click Get Video Information.
  8. To determine how the video is used in the store, select the checkbox of each Role that applies:
    • Base Image
    • Small Image
    • Swatch Image
    • Thumbnail
    • Hide from Product Page
  9. When complete, click Save.
 

suopu88

Member
XNullUser
Joined
Sep 17, 2019
Messages
103
Reaction score
1
Points
18
NullCash
4
Thanks. Very useful entry. Thanks. Very useful entry.
 

hkatlane

Member
XNullUser
Joined
Nov 26, 2019
Messages
110
Reaction score
2
Points
18
NullCash
9
Thanks. Very useful entry. Thanks. Very useful entry.
 

jastra2it

Member
XNullUser
Joined
Sep 7, 2020
Messages
59
Reaction score
0
Points
6
NullCash
4
sicuramente un ottimo medoto per risolvere la questione grazie tanto
 

zyhivan

Member
XNullUser
Joined
Aug 6, 2021
Messages
571
Reaction score
0
Points
16
NullCash
2,521
Wow. I'll try it! Thank you so much! Thank you so much!
 
Top