Feature #808

Plugins: Support for external calls

Added by Fábio Ferreira over 1 year ago. Updated about 1 year ago.

Status:AcceptedStart date:12/15/2011
Priority:NormalDue date:
Assignee:Andreas Öman% Done:

0%

Category:plugins
Target version:Near future

Description

It would be extremely helpful if we could instead of opening routes, execute them. For example, in a route called youtube:getVideoUrl:<url of video> it would simply return the link of the video we want and we would save it to a variable, basically to make code more usable. This is a needed feature because some websites, for example, rely on Youtube, instead of adding the same function over and over again, we could use the plugin destined for it, in this case, Youtube.

History

#1 Updated by NP ... over 1 year ago

This is already possible. For example if you have hd trailers plugin installed.
You can do something like this :

page.appendItem( "hdtrailers:present:/movie/men-in-black-3/", "directory", {title: "Remote"});

This will work like a charme.
The problem is how do you know that the URI handler exist?

#2 Updated by Andreas Öman over 1 year ago

  • Status changed from New to Accepted

I think showtime.probe() could be extended to handle this.
Right now it doesn't but it should be rather easy to fix.

#3 Updated by Fábio Ferreira over 1 year ago

Yes that would be good, but was not exactly that what I meant, I was talking about executing routes in middle of functions, not call them per user request, basically it would be automatically, instead of manually.

#4 Updated by Andreas Öman over 1 year ago

Fabio Ferreira wrote:

Yes that would be good, but was not exactly that what I meant, I was talking about executing routes in middle of functions, not call them per user request, basically it would be automatically, instead of manually.

I think you can mean two things here (both make sense I guess)

  1. execute a navOpen() event which will just open a new page just like if the user clicked on an item that is bound to open a new URL by itself.
  2. redirect the current page. So instead of populating the page the page handler does some kind of page.redirect('someuri:');

I can implement both I guess.

#5 Updated by andreus sebes over 1 year ago

+1 for this feature

#6 Updated by Fábio Ferreira over 1 year ago

  1. execute a navOpen() event which will just open a new page just like if the user clicked on an item that is bound to open a new URL by itself.

It is that, but preferably, that new page would be "hidden" in which would execute it's code and return some content that we can use, closing after that, but the main function that called that nav would be open during all process and regain privileges to execute once the new page would be closed and content returned.

For example, calling from another plugin youtube:video:finalLink:<id> that would return the link for the video, basically a function in other plugin.

#7 Updated by Andreas Öman over 1 year ago

  • Target version changed from 3.4 to Near future

Also available in: Atom PDF