Support » Plugin: Autoptimize » Youtube embed being removed

  • Resolved facter



    Sorry, I’ve looked for this answer but cant find it – I am having problems with autoptimize removing embedded youtube videos from my website.

    What setting can I use to avoid this, and still be able to use autoptimize to its best efficiency? Big fan of this app, but need to revolve this issue.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Frank Goossens


    that clearly is not supposed to happen. can you describe how you embed youtubes?

    Plugin Author Frank Goossens


    Just had a quick look at your site, I think the problem is due to the bj-lazy-load plugin (which relies on jquery).

    In that case, you could try one of these things (from easy but coarse to hard but fine-grained);

    1. disable js optimization (leaving you with HTML & CSS optimization)
    2. leave js optimization enabled, but check the option “force javascript in head
    3. leave js at bottom of HTML, but exclude jquery.js and/or bj-lazy-load.js

    Hope this helps,

    Hi Frank, thanks a lot for your reply.

    Could I just clarify one or two things – does the autoptimise automatically put javascipt at the bottom? I was looking to do this manually and wasnt sure that this is what the plugin did – Id rather try to get it working with js optimisation as its one of the few things that my speed checks always fail on.

    If I check “force javascript in the head” does that negate the default function of placing the js at the bottom? Obviously these are probably standard questions, I just wanted to get clarification on some of the things Ive read.

    Again, thanks for your help – nice to get such a speedy reply as well 🙂

    Okay, I tried the last option first, and no dice on that

    In the console I got the following errors

    "Lightbox was not able to find it's javascript script tag necessary for auto-inclusion. autoptimize_2696bf0ea917f6d5cba565775feaecce.php:4
    b.extend.construct autoptimize_2696bf0ea917f6d5cba565775feaecce.php:4
    b.LightboxClass autoptimize_2696bf0ea917f6d5cba565775feaecce.php:4
    (anonymous function) autoptimize_2696bf0ea917f6d5cba565775feaecce.php:7
    (anonymous function) autoptimize_2696bf0ea917f6d5cba565775feaecce.php:7
    Uncaught TypeError: Cannot convert undefined or null to object autoptimize_2696bf0ea917f6d5cba565775feaecce.php:4
    b.extend.domReady autoptimize_2696bf0ea917f6d5cba565775feaecce.php:4
    (anonymous function) autoptimize_2696bf0ea917f6d5cba565775feaecce.php:4
    c [VM] jquery.js?ver=1.10.2 (2432):3
    p.fireWith [VM] jquery.js?ver=1.10.2 (2432):3
    x.extend.ready [VM] jquery.js?ver=1.10.2 (2432):3
    q [VM] jquery.js?ver=1.10.2 (2432):3
    Resource interpreted as Script but transferred with MIME type text/html: "". [VM] autoptimize_2696bf0ea917f6d5cba565775feaecce.php (2810):21
    (anonymous function) [VM] autoptimize_2696bf0ea917f6d5cba565775feaecce.php (2810):21
    h [VM] embed.js (3046):1
    e.trigger [VM] embed.js (3046):1 [VM] embed.js (3046):1
    h [VM] embed.js (3046):1
    e.trigger [VM] embed.js (3046):1
    (anonymous function) [VM] embed.js (3046):1
    h [VM] embed.js (3046):1
    e.trigger [VM] embed.js (3046):1
    (anonymous function)"

    I then removed both the javascripts from the exclusion list and tried it again, but,alas, it still gave the same error.

    I then tried disabling javascript optimisation altogether – and, well, it did obviously work … however, the main reason I wanted to use the plugin was for javascript optimisation – Id like to find a way to get it working and have that in place – its the metric Im trying to fix up 🙂

    Thanks again for your help!

    Plugin Author Frank Goossens


    AO indeed does put scripts at the bottom by default, and “force javascript in head” changes that default behavior.

    Regarding the errors; I would continue with trial and error, excluding jquery.js, but also jquery.lightbox.min.js and jquery.lightbox.plugin.min.js in that case.

    Plugin Author Frank Goossens


    were you able to test/ fix this facter?

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Youtube embed being removed’ is closed to new replies.