function add_embed_filter($html) {
return '<div class="js-video widescreen">'.str_replace("?feature=oembed", "?html5=1", $html).'</div>';
}
add_filter( 'embed_oembed_html', 'add_embed_filter', 50, 1);
Of course if WordPress or Youtube change how this url is constructed you will have to adapt your code accordingly, but I tested it, and this will get you there with WordPress 3.8.1. I also did not test how this works for a user who does not support HTML5 and depending on your use case, you may wish to test to ensure that this code will support them.
Related Posts:
- YouTube: How to extract closed caption transcript from YouTube video?
- Is there a way to get all IP addresses of youtube to block it with Windows Firewall?
- YouTube maxresdefault thumbnails
- Youtube – downloading a playlist – youtube-dl
- URL syntax for Youtube video in fullscreen and start at time index
- How to customize an end time for a YouTube video?
- How add class youtube and type/html to oembed code?
- YouTube oEmbed and privacy-enhanced mode
- oEmbed youtube video aspect ratio
- Adding a wrapper to the youtube embed automatically?
- WordPress, oEmbed & YouTube video’s with a ‘dash’
- Link Youtube Channel In WordPress Site
- Embed youtube list with sidemenu opened
- Getting youtube links from post_content not working
- Add latest Youtube videos on main page [closed]
- How do I embed a YouTube video in WordPress 3.0?
- Echo do shortcode with custom field not working
- YouTube API 403 error when website restriction set
- How to make an image of a YouTube video appear as a thumbnail in the list of blog posts
- WordPress and Youtube problem
- Iframe Youtube video doesn’t work
- display only youtube video sticky post
- Generate a WP post from Youtube Feed
- Importing YouTube Videos As Posts – From Playlists
- Embbeded YouTube video not showing when admin logged in
- How do I get a YouTube video thumbnail from the YouTube API?
- YouTube Autoplay not working
- How do I get a YouTube video thumbnail from the YouTube API?
- Youtube api – stop video
- Youtube_dl : ERROR : YouTube said: Unable to extract video data
- Disable play/pause/full screen for HTML5
- Failed to execute ‘postMessage’ on ‘DOMWindow’: https://www.youtube.com !== http://localhost:9000
- How can I clear oEmbed caches for YouTube on posts as they are loaded
- Implementing “Video of the Day” Feature?
- Being notified when some YouTube video in some post becomes unavailable
- Set wmode attribute to transparent for the embed shortcode to make drop-down menu hover over YouTube embed in Internet Explorer
- How to change thumbnail of embedded Youtube video?
- Manipulating oembed_dataparse stopped working for YouTube embeds
- How do I display Youtube/Vimeo video ID on custom post type when user enters it in custom meta box?
- How to link to YouTube videos with thumbnails?
- Convert all youtube link to embed
- Get all Youtube video’s from posts and embed them on a different page
- WordPress 5.3.x YouTube oEmbed is not working
- Why isn’t this youtube shortcode working?
- Use oEmbed in List Items
- vimeo/youtube video embed with thumbnails
- Embed YouTube video from custom field value
- Creating bulk posts with Youtube videos
- Lightbox Plus ColorBox plugin and auto playing YouTube video
- How to import my YouTube channel into WordPress?
- WordPress site in China times out on requests to youtube [closed]
- Iframes inside bootstrap tab disappear when tab is shown
- pass user id in slug and get user information
- Cannot embed YouTube videos “Failed to embed” error
- How to auto embedded youtube with wp_insert_post()
- oEmbed not working in WordPress
- How to apply an ID to Shortcode Embedded iframe
- How to embed YouTube videos in posts without adding suggested videos at the end?
- WordPress block editor embeds not working in theme (single.php)
- WordPress keeps autoplaying my Youtube-Links no matter what I write
- How to make my new theme read [youtube id=”id of the video here” width=”600″ height=”350″]?
- How to make an embeded a Youtube video from custom field text responsive to screen size?
- Div around YouTube video
- Use Click Image to Play Youtube Video in a WordPress Loop
- Embedding Youtube video on comments
- Custom youtube shortcode that uses $content
- How to allow YouTube object embed in WordPress 3+?
- YouTube embeded video will not resize (only full screen responsive) [closed]
- iframe with Youtube video appears for logged-in users, but not for incognito users
- Add parameter to first post only
- Get YouTube video id from url in a custom field
- Looking to Customize YouTube Video Embeds
- Limit iframe output in comment-meta commentmetadata
- Static image for embedded YouTube video instead of blank player?
- Adding YouTube button to TinyMCE editor
- WordPress fails to embed video URL
- add youtube thumbnail in index and single.php add video
- Publishing a video from blog to youtube
- Right align a youtube video
- Can’t embed certain youtube videos into theme
- Block editor: Sandbox iframe shows outdated HTML
- How to modify the HTML output of Gutenberg block? (Youtube)
- Advanced Custom Fields oEmbed video width and height
- Youtube iframe embed keeps disappearing from page
- Get youtube link title in post title
- Post editor doesn’t save embed media [closed]
- Custom YouTube Plugin loading different PHP library on live site and localhost
- jQuery plugin is loaded correctly, but does nothing
- Order Posts By Youtube Views
- Widget to embed youtube video
- Filter for wp_embed_handler_youtube not working
- change output location of plugin function using a custom hook
- plugin to upload to youtube via wordpress [closed]
- Can someone please help me find a solution to my youtube embed problems? [duplicate]
- Facebook Share button wont recognize embedded video [closed]
- Fetching Video From YouTube Automatically [closed]
- Pull latest Youtube Video from json url and make new post
- Avoid embedding YouTube videos and open them in a new window
- Why isn’t my embed_video WYSIWYG field updating when using update_post_meta?
- add_filter is failing to append &rel=0 to end of YouTube URL in oEmbed