YouTube is still written in PHP

Theme: Revise content element youtube?

  • 17.12.2015, 10:24#1

    Contao fan

    Revise content element youtube?

    In the Contao demo you can actually see that the content element Youtube is not really useful as it is currently.
    Apart from the lack of responsiveness, which you can implement yourself using CSS, the full-screen display cannot be selected if you click on the square icon in the lower right corner of the player bar.
    The video obviously doesn't fit into the player either.
    Youtube already has a player, so why the mediaelement player, which is clearly causing problems?
    How do you do that, except now to include the code directly using your “own HTML code”, which of course is also a solution
    Will that possibly be revised in the future?
    LG
    Bennie

  • 17.12.2015, 10:55#2

    Community moderator
    Walking Contao Lexicon

    Quote by Bennie

    the full screen display cannot be selected if you click on the square symbol in the lower right corner of the player bar.

    So it works for me.

    Quote by Bennie

    The video obviously doesn't fit into the player either.

    What do you mean by that?

    Quote by Bennie

    Youtube already has a player, so why the mediaelement player, which is clearly causing problems?

    But that's how I see it

    Quote by Bennie
    How do you do that, except now to include the code directly using your “own HTML code”, which of course is also a solution
    Simply create your own ce_player template and build in the <!-- indexer::continue -->endblock (); ?>
    And then in "/system/modules/core/elements/ContentYouTube.php" in line 81 the following is written:

    HTML code:

    And hey presto, you have the "original" YouTube embed template.

    I also wrote a small JS so that the iFrame always adapts responsively.
    Who cares:

    HTML code:

    function resizeYoutube () {var iframeWidth = $ (window) .width (); if (iframeWidth <960 && actualWindowWidth>
    Finished.

  • 23.12.2015, 10:15#13

    Community moderator
    Walking Contao Lexicon

    Quote by MrLumbergh
    And then in "/system/modules/core/elements/ContentYouTube.php" in line 81 the following is written:

    HTML code:

    You don't have to do that. For example, I would do it like this:

    PHP code:

    PHP code:

    could be in there. I set the size using CSS anyway:

    PHP code:


  • 23.12.2015, 10:47#14

    Old Contao rabbit

    In general, I also think that you shouldn't need the change in "ContentYouTube.php".
    However, I haven't had time to see how this can be solved otherwise.

    Most of the time, the CSS solution and an adaptation of the template have been sufficient.


  • 23.12.2015, 11:24#15


  • 27.01.2016, 20:58#16

    Contao users

    Hi, I've been implementing your tips for days but unfortunately with moderate success ... sometimes the container is responsive but the video doesn't or the other way around ...

    i have the code

    HTML code:

    extend ('block_searchable'); ?> block ('content'); ?> <!-- indexer::stop -->isVideo):?> size?> src = "files as $ file):?> path?> " frameborder = "0" allowfullscreen> <!-- indexer::continue -->endblock (); ?>
    packed in its own template Ce_responsive_player

    so then i have the code:

    HTML code: