Created
November 22, 2011 22:51
-
-
Save andershaig/1387309 to your computer and use it in GitHub Desktop.
Create Videos iFrames
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// YouTube iFrame Creator | |
function getVideo(id, height, width) { | |
var output = ''; | |
var youtube_id = id; | |
output = '<iframe width="' + width + '" height="' + height + '" src="http://www.youtube.com/embed/' + youtube_id + '?rel=0&autoplay=1" frameBorder="0" allowfullscreen>'; | |
return output; | |
} | |
// Usage | |
var width = 418; | |
var height = 313; | |
var id = $('#id').val(); | |
var output = getEmbeddedPlayer(id,height,width); | |
$('#results').html(output); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment