InStream video ads and the YouTube iframe API - youtube

How is it determined if an InStream (video) ad is to be presented when using the YouTube iframe API? On my site, through limited observation, I seemed to not get any until I began using AdWords and Analytics. I also seem to not get ads when using Incognito mode in Chrome.
My site lets users create music video playlists. InVideo (overlay) ads are fine as they do not interrupt the music. However, frequent InStream ads are extremely annoying and almost defeat the purpose of the site.
Furthermore, is there any way, while adhering to the TOS, to prevent InStream ads? I see a lot of noncompliant sites have implemented their own video players, but see no compliant way to compete.

There is no way of preventing advertising (or forms of advertising) while adhering to the TOS unless you are the content owner for the videos being played.
I don't believe the method for determining what kind of ad to display is a youtube API (or programming) related question, so is probably OT here.

Related

How can I play video from YouTube channel in Decentraland?

There is sample code to play video in Decentraland. This link
However, I want to play video from a playlist in YouTube channel. Is there any sample code you can reefer me?
Unfortunately you cannot directly access any Youtube videos due to a CORS policy set on their side. This is not an issue with Decentraland itself, but rather with Youtube and other content providers that have a similar CORS policy.
Youtube and Twitch (for example) have their own javascript players that not only display ads but also gather information about the viewer. Seeing as this is the basis of their income, they do not want people bypassing this and just viewing the video for "free".
You may notice that youtube videos work in CryptoVoxel for some reason. This is due to some trickery that the game is doing, where it is loading in the html/js and placing the video on-top of the game itself. (At least that is what I've heard)
In the meantime I strongly suggest you look into hosting your videos on another platform like Vimeo. You can directly access the video files if you pay for their service. Alternatively, you can host your videos on an Antmedia server through a cloud hosting service like Digital Ocean. Both of these are great options.

How do YouTube downloaders access the videos?

I did find this answer but it uses YouTube's APIv2, and is now outdated as stated in the answer.
YouTube's terms of use state that you can't use another player or download videos, so it makes sense they've excluded it from the API.
Knowing that, how do online YouTube downloaders, or third party Android apps (that allow to turn the screen off while they keep playing music for example) access those videos?
I'm trying to access a video to stream it inside unity for example (by the way there's a couple of unity assets that do it too), and I'd like to learn how they do it.

Using Youtube API to play just audio

We are a couple of software developers and were planning on making some commercial extension or some website through which users, with slow internet connections or limited data could play almost any video through YouTube's API. Although, while going through the API docs, we came through the following section,
Your API Client will not, and You will not encourage or create functionality for Your users or other third parties to:
"separate, isolate, or modify the audio or video components of any YouTube audiovisual content made available through the YouTube API"
-Kuan Yong, YouTube API Team
Is there no such legal way through which we can disable just the video and stream audio, not even with the commercial API?
Hoping for a positive reply.
Playing just audio means isolating audio, which is a clear violation of the terms and conditions of the YouTube API. However, as far as I know, there is no such restriction when not using the YouTube API. For example, youtube-dl, which is a video downloader for YouTube and hundreds of other websites, has the functionality to download just audio.
In fact, in YouTube's format, audio and video are actually stored in separate files on the server. This means you can actually acquire the path to the audio file and stream it to you users. Check out the open-source youtube-dl, specifically the youtube module, for more details.
Edit
The reason I am merely linking to a library is that YouTube continually changes the way they format, store, and stream video. This means that retrieving the direct link to a video's audio component is a task subject to frequent change. If you can link against youtube-dl's python module, you can make use of their updates whenever such changes occur.
Disclaimer
I am not fully sure if this is all legal and whatnot. Hence, I take no responsibility for your decision on what to do, nor do I condone this kind of behavior.

Am I separating, isolating or modifying the audio or video of a Youtube Video in my Android App?

I have a responsive website for kids. Kids can watch selected Youtube Videos in a webbrowser. To make ann Android app, I used an APK creator. This app shows my website in a fullscreen webviewer. I set it up to hide the addressbar, so kids can more safely brows the App (website). On the website are no external links, except the links from the Youtube player. The YouTube video's are loading with a normal Wordpress YouTube plugin. When hitting the YouTube logo or Video URL, the Youtube website wil show.
Now Google Plays said i am violating the rules of the YouTube Api:
"Your API Client will not, and You will not encourage or create functionality for Your users or other third parties to: (8) separate, isolate, or modify the audio or video components of any YouTube audiovisual content made available through the YouTube API;"
This I truely not understand. There is no way I want to violate anything. When I appeal for reinstatement the just saying:
"After further review, we are unable to reinstate your application. You can find out more information under Reason for Suspension in the initial removal notification from Google Play."
The initial removal notification said what I wrote above.

How to use youtube api to prevent advertorials

I have build a website for my customer with embedded you tube movies. Therefore I'm using a lot of API functions. Somehow while playing a movie, commercials of concurrent company's appear.
My customer claims it has to be my used code... I belief you have to set-up your you tube channel and ad sense channel correct but you cannot prevent it completely because you tube permit double click to show commercials also...
It's not: who is right or wrong but I need to know how to prevent Ads while playing.
I hope someone could share Some knowledge with me.
Have a nice day.
Best,
Roy
You simply can't prevent ads when you play a video.
We can see in the Terms of Service of YouTuve API in the part prohibitions :
modify, replace, interfere with or block advertisements placed by YouTube in the YouTube Data, YouTube audiovisual content, or the
YouTube player;
So, if ou want use the YouTube API Players, you can't add a system to block advertissement.

Resources