Everything is working correctly now. Thanks for the help.
There were two issues.
1. My YouTube API settings were too restrictive causing trouble with adding and playing videos.
2. I removed the ‘&feature=youtu.be’ from the URL.
It would be nice if there was a simple check box to get the feature instead of having to edit functions.php.
Thanks for the code, I have added it to my child theme’s functions.php. I am not able to test it at the moment as I have run into another problem. The built in MaxGalleria video lightbox has stopped working for me.
Visit https://www.robertchildshurn.com/gallery/videos/ to see the problem.
If I use the dFactory Responsive Lightbox the video plays but the code in functions.php is not called.