Skip to content

Instantly share code, notes, and snippets.

@codeboxed
Created May 4, 2011 16:33
Show Gist options
  • Save codeboxed/955528 to your computer and use it in GitHub Desktop.
Save codeboxed/955528 to your computer and use it in GitHub Desktop.
Show YouTube videos with Titanium mobile
var win = Ti.UI.currentWindow;
// Set the window orientation modes for the video to rotate with the device
win.orientationModes = [ Ti.UI.PORTRAIT, Ti.UI.LANDSCAPE_LEFT,
Ti.UI.LANDSCAPE_RIGHT ];
// Build the movie URL. 'fs' and 'autoplay' parameters are optional.
var movieId = "d0llSyfgwEE";
var movieUrl = "http://www.youtube.com/embed/" + movieId+ "?fs=1&autoplay=1";
webview = Ti.UI.createWebView({
url : movieUrl
});
win.add(webview);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment