Questions tagged [youtube-iframe-api]

The IFrame player API lets you embed a YouTube video player on your website and control the player using JavaScript.

The IFrame player API lets you embed a YouTube video player on your website and control the player using JavaScript. Unlike the Flash and JavaScript player APIs, which both involve embedding a Flash object on your web page, the IFrame API posts content to an <iframe> tag on your page. This approach provides more flexibility than the previously available APIs since it allows YouTube to serve an HTML5 player rather than a Flash player for mobile devices that do not support Flash.

YouTube Player API Reference: https://developers.google.com/youtube/iframe_api_reference

813 questions
244
votes
29 answers

Failed to execute 'postMessage' on 'DOMWindow': https://www.youtube.com !== http://localhost:9000

This is the error message that I get: Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('https://www.youtube.com') does not match the recipient window's origin ('http://localhost:9000'). I've seen other similar problems…
Adam Zerner
  • 17,797
  • 15
  • 90
  • 156
147
votes
4 answers

Uncaught ReferenceError: ytcfg is not defined (also __ytRIL is not defined)

I have been using the YouTube IFrame Player API without problem for months and started to see this exception recently when the player loads: Uncaught ReferenceError: ytcfg is not defined Inspecting the iframe, I see a successful call to…
Thomas Vanier
  • 1,348
  • 2
  • 9
  • 7
99
votes
12 answers

YouTube: How to present embed video with sound muted

I'm trying to embed a video with the sound muted but I can not figure out how it make it work. Currently I'm using this but doesn't work: This removes right side bottom "Youtube" Logo. And also removes "Title bar"…
eegloo
  • 1,479
  • 3
  • 17
  • 29
29
votes
3 answers

Force iframe YouTube video to center fit and full cover the screen in the background using HTML5 CSS3

How do you force HTML5 iframe YouTube video to center fit, cover the full-screen window background using CSS3 HTML eventually Java? As for example "paypal.it" home page background or "unity3d.com/5" top video, has as iframe youtube video. The iframe…
Alan Mattano
  • 860
  • 3
  • 14
  • 22
26
votes
4 answers

onYouTubeIframeAPIReady() not firing

I've looked through so many questions and the youtube api stuff but for the life of me can't figure out why the onYouTubeIframeAPIReady is not working. Here is my iframe: and although it is working fine,…
AbdelHady
  • 9,334
  • 8
  • 56
  • 83
12
votes
3 answers

YouTube iframe player - trigger fullscreen on iOS

Using the YouTube iframe embed player, is there a way to trigger fullscreen programatically? I want to remove the default controls (using controls=0) but then have the ability to create custom fullscreen button by itself.
evilcelery
  • 15,941
  • 8
  • 42
  • 54
1
2 3
54 55