How to get product video as base and thumbnail in product listing page. Currently, Only Video preview image is showing in listing page. But I want to display video in listing page instead of the preview image.
Magento 2 – How to Get Product Video in Product Listing Page
magento2product-listproduct-video
Best Answer
You can get Media collection of particular product by loading it in custom helper as below:
Please copy
to your custom theme.
Now in list.phtml file, you can call this function to load the video url if it's available otherwise show the regular image:
For vimeo, add embedded urls for product video to make them playable at list page. Please note that it would take some extra time to load page first time as we are loading product to get media collection.