Load Youtube API and then Run a Script

Question Description

I need support with this Programming question so I can learn better.

I have an issue in getting the youtube API to load in time so that it works with slider script. Better if all scripts were loaded at same time so everything is ready.

Found some info on google tho not sure how to appy this to my script:

The javascript has been applied here:

Basically everything works except if you play youtube video as page is loading the slider still scrolls thro whereas it should stop so you can watch video.

It only happens on the first slide..So there is an issue of downloading the Youtube API script. IF you click on play button later as script is fully downloaded it works fine.

It works sometimes but not others.

Slider script is here: wp-content/themes/ravenswood/js/contentslider.jquery.js

and also called within head of page.

Help greatly appreciated.

Student has agreed that all tutoring, explanations, and answers provided by the tutor will be used to help in the learning process and in accordance with Studypool's honor code & terms of service.

Final Answer kindly aplly this link on it hope it works

sana naz (6)
UT Austin

Thanks for the help.

Outstanding. Studypool always delivers quality work.

Tutor was very helpful and took the time to explain concepts to me. Very responsive, managed to get replies within the hour.