I am learning about embedding videos and wanted to know which method is better? Previously, I've just used the share>embed method and pasted a bunch on one page. But I've come across the method shown here. It uses html and JavaScript to put the iframe up. Apparently there used to be another way to change the parameters, but it was deprecated? Is using the api method faster or have other benefits I should know about? I am rather new at JavaScript, but I can more or less follow what's going on.
I'd avoid using JS for something like this. The easiest way is to use a responsive html / css/ iframe embed: https://jsfiddle.net/1or0Lqf2/
Personally, I'd go with HTML5 video hosted on AWS S3 over YouTube. Especially if you are talking about on your own site. People viewing your YT videos on your site won't help your SEO and might even tempt them off your site to YT. I wrote a couple of posts on the subject you might find helpful https://www.html5videobank.com/h5-value.html https://www.html5videobank.com/about.php[/QUOTE]