How to get YouTube videos to auto play

Hi,

I am using the plugin "Featured Video Plus" with my pro extension of WordPress. 

How can i make it auto play upon loading?

And then how do i get multiple videos to play one after another?

Thank You

Heather

Comments

  • edited April 2018

    Your query is related to Featured Video Plus plugin. Wallstreet Pro Theme supports the featured image and thus plugin becomes enabled to replace featured image to your video.

    To autoplay video automatically upon loading:
    Head to wp-settings >> Media >> Default Arguments and enable checkbox for ...Always autoplay.

    Furthermore queries regarding plugin, please contact the plugin author.

    Thanks for contacting us :)
  • Hi Imraz.

    The videos now autoplay but they all play together. Can they play one after another?

    Thanks 

    Heather

  • As I see, only we can set one video to play on a page using 
    Featured Video Plus plugin. Then how did you set for multiple videos? Please share your page URL where you have set for multiple videos.

    Thanks
  • www.johnstonparkmcandrew.co.uk
  • I set the featured images on the services section to videos with the feature images plugin.

  • edited April 2018

    I have found the solution, but it needs to do a minor change in a Featured Video Plus plugin file. 

    Please confirm if you agree, I will send you the solution which enables all three images to play automatically one by one and repeat to play first after the last video ends.

    Let me know your decision first.

    Thanks
  • @heathera Any update?
  • Hi @imraz

    Sorry for the delay, i was away from the office.

    Yes we would like to go ahead with that.

    Thanks
  • edited April 2018

    Edit the plugin file class-backend.php ( wp-content\plugins\featured-video-plus\php\class-backend.php ) at line no. 817 approximately as in below attatched file change in api file.png (the change is about to add 'id'=> true)

    Make changes in Featured Video Plus's settings like in the below-attached image with name Featured_Youtube_video_settings.png. In this checkbox for iframe is enabled.

    <iframe id="play1" src="https://www.youtube.com/embed/N1GCY3b4puo?enablejsapi=1" frameborder="0" allowfullscreen></iframe>
    Use the above formate to paste in Featured Video. Only need to change youtube video ID ( ie. N1GCY3b4puo ) where
    id="play1" is for to play first, similarly below frames with id play2 and play3 followed each other.

    <iframe id="play2" src="https://www.youtube.com/embed/0QopuhdkJJw?enablejsapi=1" frameborder="0" allowfullscreen></iframe>
    <iframe id="play3" src="https://www.youtube.com/embed/mz_m5U6NDTk?enablejsapi=1" frameborder="0" allowfullscreen></iframe>

    Install plugin: Simple Custom CSS and JS, copy and paste JS script from below attached text file into this plugin. This is to load custom JS.

    Now check, Your YouTube videos auto plays in sequence. You can even share me your admin details to add this change to your theme. Email Id: [email protected]

    Let me know did it work.

    Thanks

    change in api file.png
    42K
    Featured_Youtube_video_settings.png
    53K
    script.txt
    2K
  • Hi @Imraz

    That worked!

    What would i have to adjust to make this work starting with the header video and moving on to the other three?

    Thanks
  • Hi, @heathera

    At a time only you can show 3 videos if as you are using service template for a page.

    If it's not in your case, then let me share your page URL having a header video and other three videos.

    Thanks
  • Hi @Imraz

    www.johnstonparkmcandrew.co.uk. 

    It is using the homepage template.

  • Please change the previous script with this

    Ok for fourth video, add one more frame but with id="play4"

    <iframe id="play4" src="https://www.youtube.com/embed/mz_m5U6NDTk?enablejsapi=1" frameborder="0" allowfullscreen></iframe>

    So, id with play1 will play first, then video with id play2 will play second, and so on

    Its depend on you which frame with which id you should to place for auto play in sequence manner.

    Let me know did it work

    Thanks
  • Hi @Imraz

    I tried these changes myself and they didn't work. 

    I tried it again with your resources just in case i had done something wrong and they still don't work.

    Thanks
  • Hi, @heathera

    Could you share your wp-admin details to my email address, I will complete this at my end.

    Email Address: [email protected]

    Thanks
  • Hi Imraz, 

    I emailed you last week and you haven't replied. 

    Have you had any progress on this issue? It has been a month since I last heard from you.

    Thanks
  • Hi, @heathera

    In your child theme, create two new files with name index-slider.php and index-service.php, then paste the code in both files from links https://pastebin.com/0txKjh3Z and https://pastebin.com/b8Mt6zKe respectively.


    Both files are static, to change YouTube Video, you need to edit the files and search iframe of YouTube like as below one:

    <iframe width="100%" allow="autoplay;" height="500" id="play1" src="https://www.youtube.com/embed/Pcg5dj_ArCg?enablejsapi=1&mute=1&&amp;rel=0&amp;showinfo=0" frameborder="0" allowfullscreen></iframe>

    Just change to your desired YouTube ID as marked in red color(Pcg5dj_ArCg). Now you don't need to use any plugin.

    Let me know did it work.

    Thanks
  • Hi Imraz,

    there are already files with those names. Do I need to rewrite them?
  • edited May 2018
    So for what changes you have created these files before. If you have any changes in these files then replacing code will remove your previous changes. Do you know for what changes these files are?
  • This completely fixed my issue.

    Thanks for you help Imraz.
  • edited May 2018
    Glad to help you @heathera

    You can rate us with your kind review If you like our Theme and Support.

    Thanks for contacting us :)
This discussion has been closed.