Videos you embed from YouTube, Vimeo, and other providers automatically fill the full width of your article and resize with the window, keeping their aspect ratio. You don't need any custom code for this πΊ
It works for any video you add with an Embed block, whether you insert it by URL or by embed code.
Keeping a Video at a Fixed Size
If you'd rather a video stayed at the size you set, add the noresize class to its embed code. You can do this one video at a time, and the rest will keep resizing.
If You Added Our Old Snippet
This article used to include a JavaScript snippet that did the same job. It relies on jQuery, which our current templates don't load, so all it does now is log an error in your browser's console.
If you've got it in your account, you can safely remove it from Settings > Customize > Code > JavaScript.