In the docs of the YT iframe API The playerVars property should be explained on the Supported Parameters paragraph.
https://developers.google.com/youtube/player_parameters#Parameters
Related
YouTube player API docs has a section on Accessing and modifying DOM nodes .
Which seems to say that using the method player.getIframe() returns an object with the DOM of the iframe having 'read/write' properties. Which is sort of unusual for an iframe, but google is controlling content and browser, so (I was hoping) that access could be granted while security is assured.
However, using the method player.getIframe() I personally get 4 attributes and NO childnodes(--Nodelist[]--) or children (--HTMLcollection[] -- ) and cannot seem to use js/jQ dom access methods like querySelector().
Disappointingly, this seems to be the experience reported elsewhere on SO .
Is there any way to access the DOM within the YT player API iframe, am I misreading the docs or do the docs need to be updated?!?
Can anybody help me to find a solution how to make this code work on my Wix-Site:
Click here to opt-out of Google Analytics
I have this code from Google itself (At the bottom of the page see "example"):
https://developers.google.com/analytics/devguides/collection/gajs/
Here is a Screenshot of this code from the google website:
Google Analytics Opt Out Code
I tried this:
$w("#text1").html = "<a href='javascript:gaOptout()'>Click here to opt-out of Google Analytics</a>";
But I was told that in Wix it is not possible to add events to a-tag elements in text element. Here you will find the little discussion that I had on Wix Forum:
https://www.wix.com/code/home/forum/questions-answers/how-to-link-text-to-a-url-using-w-link
I also asked on Reddit, Facebook and WixSupport. But nobody could help me with that issue.
You might want to take a look at the new wix feature called "tracking and analytics". It lets you embed custom scripts in your html's body, header, or footer.
https://support.wix.com/en/article/about-tracking-tools-analytics
You cannot access the HTML directly via Wix Code. Wix Code exposes a dedicated API for you to manipulate their controllers and elements on screen but not further under the hood.
You can use wix-fetch to call external API calls to google analytics (if they have an API to opt-out, not familiar enough to say here is the post)
anyway, your code in Wix should be something like this:
(as example API taken from their docs)
import {fetch} from 'wix-data'
fetch('https://analyticsreporting.googleapis.com/v4/...', options) // returns a Promise
Started to work with Google Maps JavaScript API v3, but in all my maps this info window is missing. Researching "Infowindow" just offers information about tag windows that open if you click on the map badge I can set.
Anybody knows how to activate this "context window" which is activated in the Google Maps iframe example? See the picture below…
The Answer to your questions is NO, there is no way to activate a context window in the API other than the info windows.
May I suggest to use a div element and with simple CSS you can position your div in front of your map or anywhere you want, and with the Google Maps API you fill this div with any info you want.
I did not find any info about that context window in the docs neither, but inspecting Google Maps I see that all of that is pure HTML.
Happy coding :)
Chrome 65, the current canary version, is blocking iframed youtube videos from auto playing with sound.
The latest changes to Chrome require the iframe to have allow="autoplay"
How do I go about adding allow="autoplay" to the youtube iframe api? I can't find it in any of the documentation.
https://developers.google.com/web/updates/2017/09/autoplay-policy-changes#iframe
A feature policy allows developers to selectively enable and disable use of various browser features and APIs. Once an origin has received autoplay permission, it can delegate that permission to cross-origin iframes with a new feature policy for autoplay. Note that autoplay is allowed by default on same-origin iframes.
<iframe src="myvideo.html" allow="autoplay">
The YouTube IFrame API has been recently updated to use allow=autoplay instead of gesture=media. It should now work as expected.
Sorry for the confusion.
You just add it in the src URL like:
autoplay
This parameter specifies whether the initial video will automatically
start to play when the player loads. Supported values are 0 or 1. The
default value is 0.
I am using the Youtube Iframe API to embed Youtube videos on a website. The client asked to have instead of the video URL as href of the Youtube Logo (the one seen on the bottom right corner) the URL of the video channel (the Youtube Channel where the video was posted).
The client claims to have seen this before on some other website, but it could not provide an example .. My guess was to try looking for some player parameters (https://developers.google.com/youtube/player_parameters) but there is no such a parameter.
I read through the rest of the API Docs and googled the issue, but had no luck so far.
Did anyone manage to do this before? Is it somehow possible?