[wp-trac] [WordPress Trac] #29534: Support JS API for Youtube Embeds

WordPress Trac noreply at wordpress.org
Sat Sep 6 02:10:23 UTC 2014


#29534: Support JS API for Youtube Embeds
-------------------------+------------------------------
 Reporter:  doytch       |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  Embeds       |     Version:  4.0
 Severity:  normal       |  Resolution:
 Keywords:               |     Focuses:  javascript
-------------------------+------------------------------

Comment (by doytch):

 Thanks for the quick reply. I know Youtube doesn't enable that param
 automatically, but I was just wondering if it was ever considered to do
 something like the below (this is code in my plugin) automatically. I'm
 guessing its a design decision to leave the optional complexity to the
 plugins, which I understand, but just thought I'd throw it out there. :)

 {{{
 add_filter('oembed_result', 'enable_yt_jsapi');
 function enable_yt_jsapi($html, $url, $args) {
         if (strstr($html, 'youtube.com/embed/')) {
                 $html = str_replace('?feature=oembed',
 '?feature=oembed&enablejsapi=1', $html);
         }
         return $html;
 }
 }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/29534#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list