Skip to content

Using with YouTube IFrame API without MLLEmbed

Alican Çubukçuoğlu edited this page Feb 4, 2015 · 1 revision

Link to Example

If you already have a YouTube IFrame API implementation, all you have to do is replace the URL of IFrame API with "https://d20psk4uwj5q3z.cloudfront.net/iframe_api". There is no need to use MLLEmbed.

<script>
//This is the original loader code:
var tag = document.createElement('script');
tag.src = "https://www.youtube.com/iframe_api";
var firstScriptTag = document.getElementsByTagName('script')[0];
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);

//All you have to do is change the URL:
var tag = document.createElement('script');
tag.src = "https://d20psk4uwj5q3z.cloudfront.net/iframe_api"; //Changed
var firstScriptTag = document.getElementsByTagName('script')[0];
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
</script>