Paste the following code in your current themes style.css file. Though all most every WordPress theme now comes with a mobile responsive design but you cannot guarantee that it is also optimized for displaying iFrame embeds such as the Youtube videos. Add this CSS to your website to make the video responsive.Responsiveness is the new trend in WordPress Theme Industry,Nobody likes to maintain a separate plugin or separate theme for presenting your site in mobile devices. Here is the main part where we’ll have to add custom CSS to make the video container responsive. This class will be needed when we’ll add custom css to make the video responsive.
In the text entry box, highlight the link you just added, then in the Editor toolbar, click the Style button (ink drop icon in the middle of the toolbar) and select > Responsive video.Just wrap the embed code with another div containing a class. By default, a video appears at 300 x 400 pixels to make the video 'responsive' so that the video resizes to fit the available space on any device. You’ve to modify the embed code a little bit when placing on the website. Keep in mind you still need a still image associated with your video, especially if you show thumbnails in your product image gallery. Click on the ALT text link for your product image and paste the YouTube or Vimeo embedded snippet. Just place the embed code where you want to add the video to your website. To embed a YouTube or Vimeo video into the product page, first edit your product and upload an image. Now you’ve copied the embed code and ready to use the code on your website.
You’ve successfully copied the embed code. Just click the COPY button or right-click above the selected HTML. Then click on the EMBED button.Īfter clicking the Embed button, it will open a big pop up like the image below.
When resized the original layout is all screwed up. Does not matter if you use the video.html file or the videoplayer.html file. With the major use of mobile devices this is a definite problem and makes for a bad viewing experience. Take for example the embedded iframe YouTube video below. I have posted before about that the pages are not responsive but it no one seemed to care. It points me to realize that iframes by default is not fully responsive in screen sizes. Open the YouTube video on a browser which you want to use on your website. The video is adjusting normally but the iframe’s height is not adapting to its video size. Step #1 – Copy Embed CodeĪt first, you’ve to copy the embed code from YouTube or Vimeo. For that, you can use FitVid, a small jQuery plugin that will take effectively any video element and make it resizable and usable in a responsive design. Follow this steps to add responsive embed video. These are all great but if youve already got your video up on YouTube, Vimeo, Blip or another video sharing site, you might just want to make that existing video embed resizable. Two common video aspect ratios are 4:3 (the universal video format of the 20th century), and 16:9 (universal for HD television and European digital television, and for YouTube videos). I found a simple CSS hack to figure out the responsiveness of embed video from YouTube or Vimeo. That’s why, though your site is responsive, the rendered video will break your site’s responsiveness because of its static width.
#How to make an embedded video responsive how to
Let’s see how to make embed YouTube and Vimeo video responsive.īy default when you copy the embed code of video from YouTube or Vimeo, and add that video on your website, they appear on the website with a default static width and height. Click Share on the video to be embedded from YouTube site to open sharing options: Step 2: Selecting iFrame.
By using CSS code we can accomplish just that without using a plugin at all: Step 1: Sharing Options. But what just I did? I ruined my blog’s responsiveness by adding the non-responsive YouTube video! But every problem has a solution. In such cases, simply pasting the iframe URL will not make the video responsive at all.
The HTML There are 3 ways you can embed Twitch on your site, embedding everything, which involves loading the Twitch Embed JavaScript that creates an