Created
May 4, 2011 16:33
-
-
Save codeboxed/955528 to your computer and use it in GitHub Desktop.
Show YouTube videos with Titanium mobile
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
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