Easy Modal
[resolved] Youtube video (4 posts)

    Posted 2 years ago #

    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!


  2. danieliser
    Plugin Author

    Posted 2 years ago #

    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.

    Posted 2 years ago #

    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!

  4. danieliser
    Plugin Author

    Posted 2 years ago #

    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 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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Easy Modal
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic