I am working on a responsive website design, and would like to incorporate in YouTube videos. The WYSIWYG toolbar has the ability to insert YouTube videos. The generated code is a simple iframe.
<iframe width="560" height="340" frameborder="0" allowfullscreen="" src="http://www.youtube.com/embed/99qm_9aJcLQ?fs=1&rel=0&enablejsapi=1&version=3" type="text/html"></iframe>
I found a website that describes a technique to make YouTube videos responsive. Is it possible to change to generated code to be wrapped inside a div, like this?
<div class="videoContainer"> <iframe width="560" height="340" frameborder="0" allowfullscreen="" src="http://www.youtube.com/embed/99qm_9aJcLQ?fs=1&rel=0&enablejsapi=1&version=3" type="text/html"></iframe> </div>
I made changes to the YouTube widget and the YouTube web part, and neither seem to affect this code.
I believe in the YouTubeVideo.ascx.cs line 171 (version 8) the last line where the MediaHelper.GetYouTubeVideo(ytParams) is retrieved, actually is what is generating that iframe tag. Should be able to wrap that literal control in the div.
Keep in mind when you do an upgrade this file will fail the upgrade because it is different that the original. So note you will have to merge any changes that might be sent over from Kentico. A better solution I failed to mention was to clone this webpart and make it "your own" THEN make the change to the HTML.
Please, sign in to be able to submit a new answer.