Skip to content

Instantly share code, notes, and snippets.

@FokkeZB
Last active May 31, 2024 05:18
Show Gist options
  • Save FokkeZB/5354066 to your computer and use it in GitHub Desktop.
Save FokkeZB/5354066 to your computer and use it in GitHub Desktop.
Embedding a YouTube video in Titanium
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();
@ygbr
Copy link

ygbr commented Feb 3, 2014

I recommend adding disableBounce: true for iOS so the webview stop scrolling youtube content.

@OwenMelbz
Copy link

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