Deprecated: Optional parameter $post_id declared before required parameter $field is implicitly treated as a required parameter in /home/jwblogger/jwBlogger/wp-content/plugins/advanced-custom-fields-pro/includes/acf-value-functions.php on line 54

Deprecated: Optional parameter $value declared before required parameter $field is implicitly treated as a required parameter in /home/jwblogger/jwBlogger/wp-content/plugins/advanced-custom-fields-pro/includes/acf-value-functions.php on line 166

Deprecated: Optional parameter $post_id declared before required parameter $field is implicitly treated as a required parameter in /home/jwblogger/jwBlogger/wp-content/plugins/advanced-custom-fields-pro/includes/acf-value-functions.php on line 166

Deprecated: Optional parameter $key declared before required parameter $value is implicitly treated as a required parameter in /home/jwblogger/jwBlogger/wp-content/plugins/advanced-custom-fields-pro/includes/ajax/class-acf-ajax.php on line 76

Deprecated: Optional parameter $i declared before required parameter $post_id is implicitly treated as a required parameter in /home/jwblogger/jwBlogger/wp-content/plugins/advanced-custom-fields-pro/pro/fields/class-acf-field-repeater.php on line 720

Deprecated: Optional parameter $i declared before required parameter $post_id is implicitly treated as a required parameter in /home/jwblogger/jwBlogger/wp-content/plugins/advanced-custom-fields-pro/pro/fields/class-acf-field-repeater.php on line 786

Deprecated: Optional parameter $name declared before required parameter $field is implicitly treated as a required parameter in /home/jwblogger/jwBlogger/wp-content/plugins/advanced-custom-fields-pro/pro/fields/class-acf-field-flexible-content.php on line 1038

Deprecated: Optional parameter $i declared before required parameter $post_id is implicitly treated as a required parameter in /home/jwblogger/jwBlogger/wp-content/plugins/advanced-custom-fields-pro/pro/fields/class-acf-field-flexible-content.php on line 1074

Deprecated: Optional parameter $i declared before required parameter $post_id is implicitly treated as a required parameter in /home/jwblogger/jwBlogger/wp-content/plugins/advanced-custom-fields-pro/pro/fields/class-acf-field-flexible-content.php on line 1126

Deprecated: Optional parameter $id declared before required parameter $field is implicitly treated as a required parameter in /home/jwblogger/jwBlogger/wp-content/plugins/advanced-custom-fields-pro/pro/fields/class-acf-field-gallery.php on line 296

Warning: Cannot modify header information - headers already sent by (output started at /home/jwblogger/jwBlogger/wp-content/plugins/advanced-custom-fields-pro/includes/acf-value-functions.php:54) in /home/jwblogger/jwBlogger/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home/jwblogger/jwBlogger/wp-content/plugins/advanced-custom-fields-pro/includes/acf-value-functions.php:54) in /home/jwblogger/jwBlogger/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home/jwblogger/jwBlogger/wp-content/plugins/advanced-custom-fields-pro/includes/acf-value-functions.php:54) in /home/jwblogger/jwBlogger/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home/jwblogger/jwBlogger/wp-content/plugins/advanced-custom-fields-pro/includes/acf-value-functions.php:54) in /home/jwblogger/jwBlogger/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home/jwblogger/jwBlogger/wp-content/plugins/advanced-custom-fields-pro/includes/acf-value-functions.php:54) in /home/jwblogger/jwBlogger/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home/jwblogger/jwBlogger/wp-content/plugins/advanced-custom-fields-pro/includes/acf-value-functions.php:54) in /home/jwblogger/jwBlogger/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home/jwblogger/jwBlogger/wp-content/plugins/advanced-custom-fields-pro/includes/acf-value-functions.php:54) in /home/jwblogger/jwBlogger/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home/jwblogger/jwBlogger/wp-content/plugins/advanced-custom-fields-pro/includes/acf-value-functions.php:54) in /home/jwblogger/jwBlogger/wp-includes/rest-api/class-wp-rest-server.php on line 1831
{"id":333,"date":"2018-04-03T15:20:53","date_gmt":"2018-04-03T22:20:53","guid":{"rendered":"http:\/\/blog.jeffwilkerson.net\/?p=333"},"modified":"2018-04-03T15:20:53","modified_gmt":"2018-04-03T22:20:53","slug":"abstracting-youtube-api-loading","status":"publish","type":"post","link":"https:\/\/blog.jeffwilkerson.net\/2018\/04\/03\/abstracting-youtube-api-loading\/","title":{"rendered":"Abstracting Youtube API Loading"},"content":{"rendered":"

I’ve been on several projects when I was asked to display Youtube videos on a webpage. Well, unless there is only one video on the page, and that video is loaded statically, you might need to leverage the Youtube API<\/a>.<\/p>\n

Every time I’ve placed a Youtube video on a page, its never as easy as slapping an IFRAME on the page. Sometimes the video loads dynamically, like when opening a modal window. Sometimes there is more than one video on the page, and you need to control the videos via javascript so that only one video plays at a time. Sometimes the web page being loaded needs to be as quick as possible, and therefore need to initialize videos on demand. To say to least, I almost always make use of the Youtube API to display videos on web pages.<\/p>\n

I’ve posted a helper module to my Github account<\/a> that abstracts the details of loading the API. The module encapsulates the code needed to load the API library asynchronously and also defines the required `onYouTubeIframeAPIReady` function that is called once the API is loaded and ready. The function fires an event from the body to notify other modules that the API is ready. Once the API is ready, modules can initialize players.<\/p>\n

Default Usage<\/h3>\n
\t\n     var ytHelper = new YoutubeHelper();\n     ytHelper.init(function() {    \t\n\n     \t\/\/ DO SOMETHING ONCE API IS READY\n\n     });<\/pre>\n","protected":false},"excerpt":{"rendered":"

This module encapulates the functionality needed to load the Youtube API<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[13],"_links":{"self":[{"href":"https:\/\/blog.jeffwilkerson.net\/wp-json\/wp\/v2\/posts\/333"}],"collection":[{"href":"https:\/\/blog.jeffwilkerson.net\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.jeffwilkerson.net\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.jeffwilkerson.net\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.jeffwilkerson.net\/wp-json\/wp\/v2\/comments?post=333"}],"version-history":[{"count":0,"href":"https:\/\/blog.jeffwilkerson.net\/wp-json\/wp\/v2\/posts\/333\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.jeffwilkerson.net\/wp-json\/wp\/v2\/media?parent=333"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.jeffwilkerson.net\/wp-json\/wp\/v2\/categories?post=333"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.jeffwilkerson.net\/wp-json\/wp\/v2\/tags?post=333"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}