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

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

Name of the video should appear on the top

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

Комментарии

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

    will test now

  • it works fine with that,
    except none of the videos are properly embedded on the playdota forums. "play directly" works though..

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

    For some reason all the elements are still visible over the video, ("play directly ..." and such) (.instant-youtube-link).
    Maybe hide everything when the video is started?

    By the looks of things, a display:block !important; on that div overrules the inline style added when the video is started (display:none;)

  • seems good now

  • Just noticed something strange on game-debate

    The article width size is 853px, not by exact value though.. which makes this exactly 480p.
    Then when the script replaces this iframe, the youtube-instant div is 852 and slightly smaller height too.
    Because of that there is a black line on the side of the embed. Now in the custom size I could increase the height so there is no black line on the side, but there will be one top/bottom.


    Can you check what is going on and why this max-width is not the full width of the article?

    1. Post a screenshot, I don't see any black lines.
    2. The article width according to CSS rules is 1350px * 75% - 160px = 852,5px
  • q1kq1k
    отредактировано July 2016 Firefox

    Here you go
    http://i.imgur.com/ND8Jkdc.jpg

    I have selected custom with 853x515 for the youtube new ui fix
    but this happens even if I go to 480p.
    And even with youtube new ui fix disabled.

  • I don't have YT fix userscript, so no black lines here both for 480p and 853x515.

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

    Well, as I said, even with that script disabled, it still happens. I still get the black line.
    http://i.imgur.com/ljgbzfE.jpg

    In the layout tab in firebug it says: 852 x 479

  • Okay, but I can't reproduce it, so I can't fix it.

  • I can't even get the script to work on chrome (tampermonkey), not even on opera (violentmonkey). Wtf?

  • Found a bug, fixed, thanks.

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

    Well I wanted to try the script and see if the black line will be there, but I can't do that.

    Anyway, as for why the black bar appears, as far as I can tell it's because of the rounding, perhaps the width is being calculated or rounded to 852 by the script. Maybe just work with the float values?
    I'm sorry, but every time I open the script I'm getting lost in there.



    On another note, it could be just calculated differently in firefox.. I just can't check in chrome.
    Maybe on my laptop it will work, I'll have to check.

  • I've fixed the bug, so it should work on fresh installations.
    Values aren't rounded in the recent versions.

  • Nothing is changed
    I still get the black line...

  • I didn't change anything related to that black line as I don't see it.

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

    Oh I see, you fixed the error caused on chrome.

    Anyway, here's what I did to get rid of the black line:
    change line 275 to:
    h = parseFloat(resizeMode);
    and line 292 to:
    var parentWidth = Math.round(parseFloat(style.width) - parseFloat(style.paddingLeft) - parseFloat(style.paddingRight));

    This way it seems to work fine both on Firefox and Chrome. Haven't tested Opera, but it probably works..

  • Good catch, updated.

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

    I have to ask, why add 0.49 here, (line 275):
    w = h / 9 * 16 + 0.49;

    I don't think that is actually needed. Because if we have 720px height, going through this equation we get 1280.49, which in the browser would end up as 1281 and thus give us a black line...

    I am using a custom size, but these other options would have a little problem.

  • It's a leftover from the old rounding formula, I'll remove it.

  • Another problem with another site.
    My custom height size is not fully displayed. Basically the "options" are not visible, and when playing the video, the controls are cut off.


    And second, here.
    The hidden videos are displayed there on the top.

  • отредактировано July 2016 Chrome
  • Problem is fixed for the second link.

    For the first though, now the player is completely visible,
    but if a higher value of height is inserted, a part of the article itself gets hidden.
    The same now happens over on the wikia pages as well.

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

    Well, both sites use an absolutely retarded method of positioning videos, and currently I'm not sure there's a safe method of hacking into it.

  • I have an idea though,
    What if you check to find A parent element that contains nothing but other empty elements and/or-just the iframe/embed.?


    so in the case here, which has a div(vid-container) with 2 elements, (an empty paragraph and a div which has only the iframe).

    The script before was replacing the second div. But now it's only the iframe.
    What my idea is, to find the empty parent element (excluding empty childs, like p and such), and to replace that one with the -instant-youtube-

    That way we won't need position absolute.

  • Nah, I can't replace the container if it has a class name or id that may be used by the site's script to control that parent element. Otherwise The hidden videos are displayed there on the top problem occurs.

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

    maybe i didn't express myself clearly enough.
    well what if we find the empty parent element (including empty childs), that doesn't have it's own height (or height: 0). and change that one?

    In the second case, those divs are not visible by default, so here don't replace that div, but the child element? oh, and they also have a certain height set.

    In the first case, this way it should get fixed.

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