Launching the youtube app
Is there a way to launch the s60 youtube app from another application.
I am working on a widget with an rss feed for a website.
the articles sometimes have youtube videos and I would like to be able to open that video in the youtube application...or if that can't be done or the user doesn't have it installed, launch the browser and go to the mobile page.
At the moment it doesn't even acknowledge there is a video there. Im assuming it's just a basic rss reader (im using the one from the wizard)
Re: Launching the youtube app
Well the launching is the easy part. The following code lists applications on the device and you can launch them just by UID.
Problems start when you try to pass parameters to the application. As the youtube application is 3rd party application I cannot really help with parameters. If the You Tube app you are referring to is a widget then there is no way to send the parameters.
So what you could do is to parse the video id from the rss stream and then from the widget call
[CODE]widget.openURL("http://m.youtube.com/watch?gl=US&client=mv-google&hl=en&v=THEVIDEOID");[/CODE]
Please check the correct use of the URL parameters from some You Tube documentation.
[CODE]
function init(){
var so = device.getServiceObject("Service.AppManager", "IAppManager");
var criteria = {
Type: "Application"
}
var result = so.IAppManager.GetList(criteria);
alert(result.ErrorCode);
//var app =result.ReturnValue.getNext();
var app = null;
while (app = result.ReturnValue.getNext()) {
document.body.innerHTML += "<input type='button' value='"+app.Caption+" "+app.Uid+"' onclick='launch("+app.Uid+");'/><br>";
}
}
function launch(uid){
widget.openApplication(uid,"");
}
[/CODE]
-Ilkka