YouTube oEmbed and privacy-enhanced mode

When you´re embed a youtube video in an iframe, you can enable the privacy-enhanced mode, so YouTube doesn´t store information about your web page visitors until they play the video. I’ve tried to embed a video via oEmbed and the URL http://www.youtube-nocookie.com/embed/xA3tfBTvH0c but it didn’t work. Is there a chance to implement a privacy-friendly solution … Read more

Correct regex for wp_embed_register_handler

THE GOAL I’m trying to parse a url and convert it to an embedded video player in my post’s content but I think my regEx is off or I’m not creating a provider correctly. THE CODE Here is what I have setup now. wp_embed_register_handler(‘brightcove’, ‘/(players.brightcove.net/)([^/]+)/([^/]+)/index\.html\?videoId=([\d]+)/g’, ‘wp_embed_handler_brightcove’); function wp_embed_handler_brightcove($matches, $attr, $url, $rawattr) { // var_dump($matches, $attr, … Read more

How to change default width parameter of embedded video in wordpress?

I am using embedded video short code of WordPress for showing video in the content of a post . and the rendered html is <iframe width=”600″ height=”338″ src=”https://www.youtube.com/embed/f5CcOq8UzkI?feature=oembed” frameborder=”0″ allowfullscreen=””></iframe> I found it really nice and cool. It works great. The only problem is video is not responsive because this takes width in px. Is … Read more

How add class youtube and type/html to oembed code?

How can i add : class=”youtube-player” type=”text/html” to iframe like : function Oembed_youtube_no_title($html,$url,$args){ $url_string = parse_url($url, PHP_URL_QUERY); parse_str($url_string, $id); if (isset($id[‘v’])) { return ‘<iframe class=”youtube-player” type=”text/html” src=”https://www.youtube.com/embed/’ .$id[‘v’].’?vq=large&autohide=1&autoplay=1&fs=1&hl=fr&rel=0&loop=1″ frameborder=”0″ allowfullscreen></iframe>’; } return $html; } 2 s 2 You can try this: add_filter( ’embed_oembed_html’, ‘custom_youtube_oembed’ ); function custom_youtube_oembed( $code ){ if( stripos( $code, ‘youtube.com’ ) !== … Read more