iphone open youtube video embed in the webview, not in the built in youtube player
Hi,
I use the following code to open a youtube video:
var movie = '<html><head></head><body style="margin:0"><embed id="yt" src="' + $url + '" type="application/x-shockwave-flash" width="' + $width + '" height="' + $height + '"></embed></body></html>';
var webView = Titanium.UI.createWebView({
html : movie,
backgroundColor : "#000000",
width : $width,
height : $height,
top : 0,
left : 0
});
This code loads an image in the webview with a play button in it and when the user clicks on it, it loads in a new window using the built-in youtube player. Is there a way to load the youtube video in my webview using the size I set and play it in there instead of loading it in the built-in player?
1 Answer
-
Hello,
you are forcing the system to load the mobile version of the video in the webview. You should provide an url like the one described here and if you want, you can use the Youtube api to get the screenshot of the video into your webview.
Best,
Mauro