I need to show product youtube video in html Video tag. For example like this

Can someone know how to achieve this?


You can do things :

  1. Host all video and player assets remotely and paste in code almost anywhere (blocks, widgets) JW Player and SlideShowPro both work on web and iOS now

  2. For pure HTML5 video tag just paste in the code (all URLs absolute and outside of Magento)

  • I have product video added in backend and need to use that video in html video tag. How to do that? – Prasanta Hatui Jun 14 '17 at 11:58
  • Try this - simply render that block and template in detail tab Add the below line in <magento-root>/app/design/frontend/Vendor/Theme_name/Magento_Catalog/templates/product/view/attribute.phtml before end of div tag <?php echo $this->getLayout()->createBlock("Magento\Catalog\Block\Product\View\Gallery")->setTemplate("Magento_Catalog::product/view/gallery.phtml")->toHtml(); ?> The output is look like below may be your styling get different because I do some LESS work for my image view. OR Refer this www.demagento.com/how-to-add-magento-product-video-programmatically/ – Khushbu_sipl Jun 14 '17 at 12:01
  • 1
    Magento default template using iframe to display video but I need to replace video tag. – Prasanta Hatui Jun 14 '17 at 12:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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