-
AuthorPosts
-
January 12, 2016 at 3:40 pm #743188
Hello,
My youtube videos are getting cropped in my posts. I do not think they are resizing properly. Here is an example, where I have embedded 2 video sizes: http://www.cookwithamber.com/sliders-3-ways-with-dj-bbq/
I expect the video to resize to fit the available space left of the sidebar. However, it is getting cropped, and the aspect ratio of the video is incorrect (they were fine before migrating over to theme X.)
This is happening with old posts (pre-X), as well as new ones created in X.
Because I will lose data for my previous posts if I use Cornerstone, I have opted out of Cornerstone for post editing.
Thank you for your help.
January 12, 2016 at 9:42 pm #743570Hi There,
Thanks for writing in! Regretfully, at this time I am not entirely certain what it is you would like to accomplish based on the information given in your post. If you wouldn’t mind providing us with a little more clarification on what it is you’re wanting to do (perhaps some screenshots), we’ll be happy to provide you with a response once we have a better understanding of the situation.
Thanks.
January 13, 2016 at 12:29 am #743762This reply has been marked as private.January 13, 2016 at 12:31 am #743766This reply has been marked as private.January 13, 2016 at 12:44 am #743795Hi there,
Please increase height value in
<iframe>
tag.<iframe src="https://www.youtube.com/embed/o0rJKMQQgYI" width="640" height="500" frameborder="0" allowfullscreen="allowfullscreen"></iframe>
Hope it helps.
January 14, 2016 at 5:19 pm #746586I did for this one, but all of my videos are having issues. Is there way to fix all without going into each post? Thank you.
January 14, 2016 at 9:17 pm #746867Hi there,
Thanks for updating the thread! Regretfully, we don’t have a way to do this for all videos without going into each post. However, I do have an updated solution that will work better responsively.
For each video embed code you enter via text editor. Wrap it inside the following HTML.
<div class="videoWrapper"> [You YouTube Embed Code goes here...] </div>
It should look something like this:
<div class="videoWrapper"> <iframe src="https://www.youtube.com/embed/o0rJKMQQgYI" width="640" height="500" frameborder="0" allowfullscreen="allowfullscreen"></iframe> </div>
Then you will need to add this CSS. You can add this under Custom > CSS in the Customizer or in your child theme’s style.css file.
.videoWrapper { position: relative; padding-bottom: 56.25%; /* 16:9 */ padding-top: 25px; height: 0; } .videoWrapper iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
You will only need to add this one, then each video you enter just add within the wrapper provided above.
Hope this helps – thanks!
-
AuthorPosts