3

Unable to add video youtube url in product page as also got error The preview image information is unavailable. Check your connection and try again.

enter image description here

I am using magento 2.4.4-p1 version

4 Answers 4

4

This error occurred, due to unable to get the remote image of youtube link. so check the youtube link or curl request is not completed as check the curl request have all access privilege .

$image = $this->curl->read();
    if (empty($image)) {
        throw new LocalizedException(
            __('The preview image information is unavailable. Check your connection and try again.')
        );
    }
1
  • Thanks . It’s worked for me . Issue with you network access. Commented Dec 29, 2022 at 6:12
2

If a given message/LocalizedException showing in the admin product edit page area then it fails in the following situations.

  • remote image source found empty, not available from a source(Youtube/Vimeo).
  • cURL request timeout here \Magento\Framework\HTTP\Adapter\Curl::read
1
  • 1
    Thanks, curl is working but issue with network and fixed. Commented Dec 29, 2022 at 6:12
1

1 - Obtain a YouTube API key

Visit the 

https://console.cloud.google.com/apis/library?project=magento2-342010

  • Select ‘YouTube Data API v3’ enter image description here

  • Select ‘Enable’ enter image description here

  • Select ‘Create Credentials’ > ‘API Key’ enter image description here

    Copy the text which displays your unique API key

2 - Adding your YouTube API key in Magento 2

  • On the sidebar of Magento go to Stores > Settings > Configuration

  • Under ‘Catalog’ select ‘Catalog’

  • Under the ‘Product Videos’ area,

  • paste your previously copied YouTube API key into
    the required field

  • Save

    enter image description here

3 - Adding a YouTube video to a Magento 2 product page

  • Now to tell Magento to insert the video on to a Product page…

  • Visit the product page edit view you wish to add the video to

  • Go to the ‘Images and Videos’ section

  • Click ‘Add Video’

  • Enter the URL of the video you wish to embed

  • Click the ‘Get Video information’ button to fill in a lot of the details and customise as required

  • Save your product enter image description here

All that is left is to check the frontend of the website to ensure your video has appeared.

Remember to clear your cache under ‘Cache Management’ for good measure if you find the video is not yet visible.

see the result in frontend enter image description here

0

Kind of your current using theme xml layout error.

Possible to check catalog_product_view.xml from the custom theme and using the reference instead copying all xml content from parent theme.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.