Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Help with tumblr’s video block CSS

  • This topic is empty.
Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #41286
    GeoUranda
    Member

    Hi! I need help with some coding for my tumblog. I want my videos and Spotify players that I post or reblog to be able to fill out the white area like my pictures do. I have fixed this with my photosets, but can’t figure a way to do this with my video block.

    Here is a link to my tumblog if it helps.
    http://beardthegiant.tumblr.com/

    Thanks in advance.

    #116936
    GeoUranda
    Member

    Would like it if TheDoc came to help.

    #116937
    chrisburton
    Participant

    @GeoUranda Set the width to 350px

    #116939
    GeoUranda
    Member

    This is the code and you really can’t change it to anything besides 250,400,500, and some other options.

    {block:Video}


    {Video-400}
    {VideoEmbed-400}

    {/block:Video}

    #116940
    chrisburton
    Participant

    @GeoUranda You can’t change any of those from 400 to 350?

    e.g.

    {block:Video}


    {Video-350}
    {VideoEmbed-350}

    {/block:Video}

    #116941
    GeoUranda
    Member

    No, the video won’t show up if you do. It’s just weird tumblr parameters.

    #116942
    chrisburton
    Participant

    @GeoUranda and you said you can’t change any CSS to your site’s theme?

    #116945
    GeoUranda
    Member

    Well I can, but I wouldn’t know how to go about doing it. I didn’t make this particular theme, but I did a lot of my own patch ups if you know what I mean. I edited it a lot. Mostly the customCSS part though so not too much.

    #116946
    chrisburton
    Participant

    @GeoUranda Try editing your custom CSS and add this

    #outerWidgetContainer {
    width: 350px;
    }

    #116947
    GeoUranda
    Member

    Where in the code should I add it?

    #116950
    TheDoc
    Member

    Unfortunately there’s no real easy way to do this with CSS. In our themes we generally use some simple jQuery:

    function resizeVideo(newPosts) {
    var videos;
    if( newPosts === undefined ) {
    videos = $(“#blog #posts article.type-video”);
    } else {
    videos = $(newPosts).filter(‘.type-video’); // infinite scroll has kicked in
    }

    videos.each( function() {
    var video = $(this).find(“.video iframe, .video embed”);

    video.css({opacity: 0});

    // resize video to 460px and retain aspect ratio
    var videoHeight = video.height()
    var videoWidth = video.width();

    var videoRatio = (videoHeight / videoWidth);

    var newWidth = 460;
    var newHeight = Math.floor(newWidth*videoRatio);

    video
    .removeAttr(‘height width’)
    .width(“100%”)
    .height(newHeight)
    .css(‘opacity’,1);

    $(this).find(‘.tumblr_video_container’).height(newHeight).width(‘100%’);

    });

    } // end resizeVideo

    On page load it gets called like this:

    resizeVideo();

    Then when infinite scroll gets kicked in it gets called like this:

    resizeVideo(newElements);

    Obviously you’d need to change a few of these things to get it up and running. Simple CSS changes aren’t going to properly alter the iframes, I’m afraid.

    #116955
    GeoUranda
    Member

    So how would I go about doing this? I’ve had little exposure to HTML and CSS to be honest.

Viewing 12 posts - 1 through 12 (of 12 total)
  • The forum ‘CSS’ is closed to new topics and replies.