How make youtube videos responsive in activity stream?
-
If posts contain a video from youtube those videos are not responsive in the activity stream.
I tried to use the class .activity-inner to make the video responsive, it worked for the video but at the same time it added big paddings to all other posts in the activity stream. So it’s not really an option.
I used the following css
.activity-inner { position: relative; padding-bottom: 56.25%; padding-top: 35px; height: 0; overflow: hidden; } .activity-inner iframe { position: absolute; top:0; left: 0; width: 100%; height: 100%; }
Now I was wondering if there’s a way to add an additional a <div class=”video-responsive”></div> container only to youtube (iframe) embeds but not to other posts that don’t contain a video?
This additional div seem to be neccessary. If I leave that out and make the iframe width and height to 100%, the width of the youtube video gets displayed correctly but not the height (cut off).
Any help would be appreciated.
- You must be logged in to reply to this topic.