I'm embedding YouTube videos in a widget (http://www.betterdonatebutton.com) to help non-profits raise money. Unfortunately, some of them are not technically inclined enough to turn off ads that display over their videos.
How do I embed a YouTube video and specify that I prefer no ads to be displayed?
If you had permission from the content owners of the videos to upload copies in your own account, and then ensured that your account was set up with monetization turned off, then that would prevent ads from showing during playback. It's up to you to work out that arrangement/permission with the original videos' owners, of course.
(It's also worth pointing out that if your goal is to help non-profits raise money, then allowing them to monetize their video playbacks is in line with that goal...)
If you play the video as a playlist and then single out that video you can get it without ads. Here is what I have done: https://www.youtube.com/v/VIDEO_ID?playlist=VIDEO_ID&autoplay=1&rel=0
I'd just like to add, and please correct me if I'm wrong, that when I embed the HTML5 version of the videos, it doesn't play ads on top.
Not sure if this will ever change. They're probably just trying to work out the best way to show ads on the HTML5 player.
From the YouTube help:
You will automatically be opted into showing ads on embedded videos if you've associated your YouTube and AdSense accounts and have enabled your videos for embedding.
If you don't want to show overlay ads on your embedded videos, you can opt your videos out of showing overlay ads, though this will also disable overlay ads on your videos on YouTube.com. You may also disable your videos for embedding.
https://support.google.com/youtube/answer/132596?hl=en
Another technical solution could be to use a custom video player, and streamline the youtube video with that one. Have not tried but guess that the ads cannot be displayed in a custom player. However, could be forbidden.
来源:https://stackoverflow.com/questions/13981310/embed-youtube-video-with-no-ads