1

I've been digging around the Stack Overflow threads, and can't seem to find this issue addressed exactly. I set up and Angular app, and I would like to be able to call methods on a YouTube API from within multiple controllers and directives (such as playVideo() and pauseVideo() etc)

The video will be persistent throughout the site.

I initially set up the API via a service and subsequently injected it into the various controllers. I used a $rootscope.$broadcast to send a message when the player was ready, but I could never get the actual player returned, just an empty object.

To make matters worse, I rebuilt the site statically so have no example code to show here, but was hoping someone might be able to outline the basic procedure here.

Thanks, James

1 Answer 1

2

YouTube Topic explorer uses iframe inside the angular script. You can basically create your own function or directive to use the iFrame.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.