video-embed-loader.js

Gesponsorde koppelingen

PHP script bestanden

  1. video-embed-loader.js

« Lees de omschrijving en reacties

var VideoEmbedLoader = {
flashSupported: function()
{
return navigator.mimeTypes
&& navigator.mimeTypes["application/x-shockwave-flash"];
},
loadAll: function(elem)
{
if(!elem)elem = document.body;
var divElements = elem.getElementsByTagName("div");
for(var i=0; i<divElements.length; i++)
{
var div = divElements;
if(div.className != "youtube-embed") continue;
VideoEmbedLoader.appendPlayerIn(div.getAttribute("video"), div);
}
},
appendPlayerIn: function(vidcode, elem)
{
if(VideoEmbedLoader.flashSupported())
{
var iframe = document.createElement("iframe");
iframe.src = "http://www.youtube.com/watch_popup?v="
+vidcode+"&vq=large";
iframe.className = "youtube-embed-player";
iframe.setAttribute("frameborder", "0");
elem.appendChild(iframe);
}
else
{
var embed = document.createElement("embed");
embed.src = "http://www.youtube.com/v/"+vidcode+"?fs=1";
embed.className = "youtube-embed-player";
embed.setAttribute("type", "application/x-shockwave-flash");
embed.setAttribute("allowscriptaccess", "always");
embed.setAttribute("allowfullscreen", "true");
elem.appendChild(embed);
}
}
};

window.onload = function()
{
VideoEmbedLoader.loadAll();
};

 
 

Om de gebruiksvriendelijkheid van onze website en diensten te optimaliseren maken wij gebruik van cookies. Deze cookies gebruiken wij voor functionaliteiten, analytische gegevens en marketing doeleinden. U vindt meer informatie in onze privacy statement.