Videos are a great way to enrich your content since it is proved that information is perceived better by watching videos than reading a long one-piece text. Therefore you should definitely consider embedding YouTube videos to your content. There are two ways you can insert videos in Magento 2: Default WYSIWYG Media Tool and Magento 2 YouTube Widget. Let's find out which is better analyzing their features and performance.
Default WYSIWYG Media Tool
Magento naturally has the Media Tool, which allows you to insert videos into your content.
Once you press it there appears an insert/edit media popup. In the General section, you have to insert the Source link of the YouTube video you want to be embedded and set its Dimensions. Put the checkmark to constrain the proportions.
You are also able to Embed the Code of the video you want to insert in the corresponding section.
Finally, in the Advanced section, you can set the Alternative Source and the Poster which will be the screensaver of your video. Note that this section is optional, so you can leave these fields blank.
Once you've finished and pressed OK button, you will see your video successfully inserted.
This is how it will look like on the storefront.
Magento 2 Youtube Widget by Magefan
The same as with the Media Tool there is a Widget Tool in Magento 2.
Once you install the Magento 2 Youtube Widget module you will be able to choose it from the list of widgets available.
The options YouTube widget is equipped with are the following:
- YouTube Video URL.
- Width and Height. If you leave these fields blank 100% width and 400px height will be used.
- Start At. You can set the time video will start from in case there is a certain moment you want to be shown.
- Repeat (loop) Video. Enable this option if you like the video to be repeated once it's finished.
- Display Related Videos. If you are, for example, sharing videos from your YouTube channel you might want to display some related ones.
- Allow full screen. If this option enabled video viewers will be able to turn the video to the full screen.
- Preview Image Quality. The quality of the Poster which is automatically generated from the YouTube.
Once you press the Insert Widget button you will see the YouTube video to be embedded into the WYSIWYG editor.
According to the options you choose your video will be displayed on the storefront like this:
Why should I use the paid module instead of the natural Magento functional?
First of all Magento 2 YouTube widget gives you a lot of options to display YouTube videos as you want. Second and not less important feature is webpage speed. This module has video and video image lazy load so that video content starts loading only when a customer clicks the play button and if the video is somewhere in the bottom or middle of the page, its image will not be loaded until a visitor scrolls down. Compared to that, Default Media Tool inserts IFRAME that increases the page time load. So the difference is quite obvious.