Thursday, 19 September 2013

How to show last screen of Youtube Video when youtube video finishes?

How to show last screen of Youtube Video when youtube video finishes?

I am adding youtube video link in my web application using following
JavaScript code. This is working Fine. But when Video finishes by default
youtube video gives other links divided in small square boxes, I dont want
this.
When video finishes then black screen should appear or whatever is the end
screen there in video should appear.
Can we do this? If yes then how?
youtubeLoadVideos : function () {
var videos = document.getElementsByClassName("youtube");
for (var i=0; i<videos.length; i++) {
var youtube = videos[i];
var iframe = document.createElement("iframe");
iframe.setAttribute("src", "http://www.youtube.com/embed/" +
youtube.id);
// The height and width of the iFrame should be the same as
parent
iframe.style.width = youtube.style.width;
iframe.style.height = youtube.style.height;
iframe.style.clear = 'both';
youtube.parentNode.appendChild(iframe, youtube);
//youtube.appendChild(youtube.id);
}
}

No comments:

Post a Comment