Last active
May 31, 2024 05:18
-
-
Save FokkeZB/5354066 to your computer and use it in GitHub Desktop.
Embedding a YouTube video in Titanium
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.createWindow(); | |
var webView = Ti.UI.createWebView({ | |
url: 'http://www.youtube.com/embed/' + myVideoID + '?autoplay=1&autohide=1&cc_load_policy=0&color=white&controls=0&fs=0&iv_load_policy=3&modestbranding=1&rel=0&showinfo=0', | |
enableZoomControls: false, | |
scalesPageToFit: false, | |
scrollsToTop: false, | |
showScrollbars: false | |
}); | |
win.add(webView); | |
win.open(); |
I recommend adding disableBounce: true for iOS so the webview stop scrolling youtube content.
Trying this on 3.2.3GA however I'm just getting a white page - when I use the same URL in my desktop browser the video loads as it should. Any ideas?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Using the following, you can pop open the native player app instead:
Works on iOS & Android, assuming native player app is installed. If not, you get the video embedded in a browser.