Привет, незнакомец!

Похоже, вы здесь новенький. Чтобы принять участие, нажмите одну из кнопок ниже!

Name of the video should appear on the top

Скрипт: FYTE /Fast YouTube Embedded/ Player
1235789

Комментарии

  • That's too fragile.

  • What if we check if the parent element has padding-bottom/ top, of 56.25% (since this is what they use to create this "responsive design"),
    then get the computed height of the element, and increase it along with the -instant-youtube- ?

  • And how to discern reliably this type of positioning from something innocent and adjust it precisely?

  • What do you mean?
  • I think I found a reliable method. The script is updated.

  • q1kq1k
    отредактировано July 2016 Firefox

    Nope, still no effect, my custom sized player is still being cut.

  • Use Stylish addon. I can reliably alter simple cases only, like the wikia page.

  • Ah, forgot I have added a per-site config, so here it goes: http://p.ip.fi/G-pP

  • q1kq1k
    отредактировано July 2016 Firefox

    Ok, with that one it replaces most of the parent divs(video-container), but not all of them...

  • отредактировано July 2016 Chrome

    Nah. I saw it just once in FF, but not anymore. It's beta though, that's why, I guess.
    Anyway, if you can reproduce it reliably, I need more info like DOM tree screenshot in devtools etc.

  • q1kq1k
    отредактировано July 2016 Firefox

    No matter how many times I reload the page. There are 2 videos' parent elements are not replaced.
    https://s31.postimg.org/bmcrrxaw9/Untitled.jpg

  • q1kq1k
    отредактировано July 2016 Firefox

    The 2 videos are still not replaced, that's the second and last video there.

    Also the padding issue is back on the wikia (the empty space below the video.).

  • отредактировано July 2016 Chrome

    http://p.ip.fi/pceS

    I'm disappointed with FF.
    I've added a workaround for its bug with getComputedStyle, so now padding on wikia is fine.
    But I don't know how to fix its buggy behavior of such a basic DOM function as getElementsByTagName that works perfectly in Chrome... so I just don't want to waste my time any more. Maybe I'll invent something later.

  • q1kq1k
    отредактировано July 2016 Firefox

    Thanks, that works.

    I will ask you again to put the extra option, "additional height", so as to add extra height on top of the calculated height.
    Right now, on every update I have to edit the script and change line 351 to:
    return {w:w, h:(h+35)}; (the 35px is for youtubenew ui fix)

    Now that +35 part could be a user input value:
    image

  • отредактировано July 2016 Chrome

    That's the price you have to pay for not moving along with the times :-)

  • q1kq1k
    отредактировано July 2016 Firefox

    That's the price you have to pay for not moving along with the times :-)

    But I don't like the controls bar to auto hide :(
    At least if it isn't fullscreen that is...

    Also, editing the script will disable future updates alerts.

  • q1kq1k
    отредактировано July 2016 Firefox

    Hey, there is a problem with some sites centering the videos.
    Here, there are videos on the bottom, clicking one of them will open a modal window and the video should be centered,
    but the script adds margin: 0 !important; as style to .instant-youtube-container, and as inline style. thus making it impossible for me to quickly fix it with stylish.
    Now if there wasn't the inline style (or at least the inline style wasn't !important), it will be possible to change it with stylish.

  • отредактировано July 2016 Chrome

    I have to add inline !important styles in order to keep things from falling apart due to site's rules.

    As for this site I don't understand how that iframe gets centered because there's no display:inline rule for the iframe, but it ends up with that rule anyway.

    Even if I delete margin rule, nothing changes.

  • q1kq1k
    отредактировано July 2016 Firefox

    As for this site I don't understand how that iframe gets centered because there's no display:inline rule for the iframe, but it ends up with that rule anyway.

    The default alignment on the iframe is through this:
    .LightboxModal .media { line-height: 100%; text-align: center; /* this centers the elements, (the iframe has .media class btw) */ }

    Even if I delete margin rule, nothing changes.

    The script add margin:0!important; on 2 places, inline and the normal class .instant-youtube-container

    They have this thing though:
    .LightboxModal .video-media embed, .LightboxModal .video-media object, .LightboxModal .video-media > div { display: block; margin: 0 auto; }With it if there were no !important margins, this will make them centered anyway.



    So only removing the inline !important margin, would make this fixable with stylish.

  • отредактировано July 2016 Chrome

    I meant the iframe shouldn't have been centered even without my script interfering...
    Well, apparently, there's no need to adopt the original margin anyway.
    Test this: http://p.ip.fi/HRCk

    And here's an automatic height adjustment companion script for you: http://p.ip.fi/d3EK - I've tested it for size=480p in the main script's options.

  • q1kq1k
    отредактировано July 2016 Firefox

    I meant the iframe shouldn't have been centered even without my script interefing...
    Well, apparently, there's no need to adopt the original margin anyway.
    Test this: http://p.ip.fi/HRCk

    Thanks, now I can take care of it with stylish.

    Also when choosing 480p, the max-width should be 853 not 853.333,
    because if it's .333 there is a black line on the right side of the video, at least there is on FF.
    I know the formula gives it that width, but perhaps the value that is returned should be integer?

  • Mathematical rounding of 853.333 should produce 853, so blame Firefox.

  • q1kq1k
    отредактировано July 2016 Firefox

    Yeah, but if we add math.round in line 351:
    return {w:Math.round(w), h:h};
    problem is solved.

  • And yet another issue with wikia.
    Videos like these are not visible when playing.

  • I've added min-width: <ORIGINALWIDTH> for all videos and a special rule for this wikia: http://p.ip.fi/X1Xf

  • q1kq1k
    отредактировано July 2016 Firefox

    There are more issues with eatparent: 2.
    I tried setting it to 1 and there seems to be no problems so far.

  • What more issues?

Войдите или Зарегистрируйтесь чтобы комментировать.