Skip to content

Instantly share code, notes, and snippets.

@boydlee
Created July 16, 2012 14:16
Show Gist options
  • Save boydlee/3122961 to your computer and use it in GitHub Desktop.
Save boydlee/3122961 to your computer and use it in GitHub Desktop.
youtube video
// this sets the background color of the master UIView (when there are no windows/tab groups on it)
Titanium.UI.setBackgroundColor('#000');
// create tab group
var tabGroup = Titanium.UI.createTabGroup();
//
// create base UI tab and root window
//
var win1 = Titanium.UI.createWindow({
title:'Tab 1',
backgroundColor:'#fff'
});
var youtubeEmbeddedHtml = "<html><head>";
youtubeEmbeddedHtml += "<meta name = \"viewport\" content = \"initial-scale = 1.0, user-scalable = no, width = 212\"/></head>";
youtubeEmbeddedHtml += "<body style=\"background:#FFFFF;margin-top:20px;margin-left:0px\">";
youtubeEmbeddedHtml += "<div><object width=\"320\" height=\"240\">";
youtubeEmbeddedHtml += "<param name=\"wmode\" value=\"transparent\"></param>";
youtubeEmbeddedHtml += "<embed src=\"http://www.youtube.com/v/?id?f=user_favorites&app=youtube_gdata\"";
youtubeEmbeddedHtml += "type=\"application/x-shockwave-flash\" wmode=\"transparent\" width=\"320\" height=\"240\"></embed>";
youtubeEmbeddedHtml += "</object></div></body></html>";
var wb = Ti.UI.createWebView({
html: youtubeEmbeddedHtml.replace('?id', 'FG6iF7fPzkU'),
width: 320,
height: 320,
top: 50,
left: 0
});
win1.add(wb);
// open tab group
win1.open();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment