• Resolved JAUMENUEZ

    (@jaumenuez)


    Seems like the pulgin loads the modal content in hidden mode, and on click dispays it.

    In my modal I want to place a Youtube video in autoplay mode.

    The problem is that I don’t want it to autoplay directly and hidden when loading the page.

    Any ideas to address this?

    Thank you very much!

    http://wordpress.org/plugins/easy-modal/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Daniel Iser

    (@danieliser)

    I do have an idea about this bit haven’t found the full solution yet. What’s missing and you may find it with a quick google search I just haven’t researched it yet is the JavaScript to make the video play.

    Basically you can override the modals open function and during opening you would need som JS to start playing the video.

    I am on my mobile at the moment so if you find it and paste it here I will be glad to write up a solution. Eventually including it in the plugin itself.

    Thread Starter JAUMENUEZ

    (@jaumenuez)

    OK I’ll try to find some solution, I’ll look for it in the Youtube API page and let you know if I find something.
    Thanks for your plugin!

    Plugin Author Daniel Iser

    (@danieliser)

    Hey Jaumenuez, this might be what your looking for. If not you can replace the code in the middle with the correct code for videos.

    $('.eModal-1').click(function(e){
      e.preventDefault();
      $('#eModal-1').emodal('open');
      $("#eModal-1 iframe").attr('src', $("#eModal-1 iframe").attr('src') + '?autoplay=1');
    });

    Try that js out and let me know. This is for youtube btw. There are much more complicated ways to do it but this may be quick and easy for your needs.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Youtube video’ is closed to new replies.