PluginOverview » History » Version 16
Version 15 (Leonid Protasov, 01/25/2015 12:58 PM) → Version 16/26 (Leonid Protasov, 03/21/2015 04:02 PM)
h1. Overview
Plugins for Movian Showtime are currently written in ECMAScript.
*Since 2010 Movian Showtime Media Center have been using SpiderMonkey 1.8.0-rc as JavaScript engine. However, SpiderMonkey planning to be phased out and be fully replaced with the engine called Duktape (http://duktape.org). Currently (beginning from v4.8) Movian Showtime Media Center contains both engines. Most of the features are compatible and a special document will be crafted on how to port plugins to from SpiderMonkey JavaScript to Duktape ECMAScript.*
This document assumes the reader has good understanding of ECMAScript. There are plenty of books and sites on the subject so in this document is not going to waste space or time on teaching the ECMAScript language itself.
The Movian Showtime Media Center plugins do not interact directly to the user via the user interface (similar to a web browser) but rather respond to browse and search requests and populate the internal data model with information that is then presented to the user via Movian's Showtime's user interface(s).
h1. Structure of a plugin
Each plugin resides in a directory of it's own. This directory must contain a file *plugin.json* which contains information about the plugin. For more information about this file, please see the section named plugin.json below.
Apart for the plugin.json file there are no further restrictions of what the files are named in the plugin directory or if files are placed in sub-directories, etc
h2. plugin.json
plugin.json is a JSON (http://www.json.org/) encoded text file
containing information about the plugin
Example of a plugin.json file (from the Headweb plugin):
<pre><code class="javascript">
{
"type": "ecmascript",
"apiversion": 1,
"id": "headweb",
"file": "headweb.js",
"showtimeVersion": "4.1.22",
"version": "1.5.3",
"author": "Andreas Öman",
"title": "Headweb",
"icon": "headweb_square.png",
"synopsis": "Headweb online video",
"category": "video",
"description": "<p>Headweb is a Swedish online video store.<p>For more information, visit <a href=\"http://www.headweb.com\">http://www.headweb.com</a>",
"homepage":"https://github.com/andoma/showtime-plugin-headweb"
}</code></pre>
Description of fields and requirement of their presence:
h3. type (REQUIRED)
Type of plugin, as described by the following list.
* @[email protected] - Loads the plugin using Duktape.
* @[email protected] - *(deprecated)* Loads the plugin into the SpiderMonkey engine. This is planned to be removed in Movian 4.10 Showtime 5.0 so any use is discouraged.
* @[email protected] - used for on screen keyboard plugin
h3. apiversion (OPTIONAL)
Only applicable if type is @[email protected], ie. when running using the Duktape engine. This controls the API exposed by Movian showtime to the plugin.
* 1 - The version 1 API is _mostly_ compatible with the API exposed through the SpiderMonkey engine.
* 2 - The version 2 API is a new API which more resembles modern ECMAScript using modules and CommonJS interfaces. Please try to use this.
The version 1 API is emulated using the version 2 API using JavaScript wrappers. The emulation code can be found here https://github.com/andoma/showtime/blob/master/resources/ecmascript/legacy/api-v1.js
h3. id (REQUIRED)
Unique identifier for a plugin. The IDs are assigned by the Movian Showtime project. Any ID starting with the string "test" is reserved for development and can be used by plugin developers until a final ID has been assigned. The assigned IDs will be ASCII lowercase. To get an ID please mail [email protected]
h3. file (REQUIRED)
Name of the plugin executable/script. Usually it's a good idea to give the file a name resembling the plugin ID.
h3. title (RECOMMENDED)
Short title of the Plugin. If omitted the 'id' field will be used instead which might look a bit bad due to lowercasing, etc
h3. showtimeVersion (RECOMMENDED)
Minimum version required of Movian Showtime for this plugin to work. If the current version of Movian Showtime is less than this version the user won't be able to install the plugin but will be notified about what version
of Movian Showtime is required. The same goes if a plugin is updated and the new version requires a newer version of Movian. Showtime. Then the user will be refused to upgrade the plugin. If this field is omitted Movian Showtime will assume the plugin works on all versions of Movian. Showtime.
h3. version (RECOMMENDED)
Version of the plugin. If this does not match the current installed version of a user's plugin the user will be presented with the possibility to upgrade the plugin. If the field is omitted Movian Showtime will set the version to "Unknown"
h3. category (RECOMMENDED)
Category of the plugin. If the field is omitted Movian Showtime will set the category to "Unknown". Following categories are known:
"tv" - online TV
"video" - streaming video
"music" - streaming music
"glwview" - UI extentions
"subtitles" - subtitles
"glwosk" - on screen keyboard
h3. synopsis (RECOMMENDED)
A short one line summary of the plugin or the service it accesses
h3. author (OPTIONAL)
Plugin developer. Any UTF-8 characters are valid.
h3. homepage (RECOMMENDED)
An URI with the location of the plugin homepage
h3. icon (OPTIONAL)
Path to plugin icon. The path is relative to the plugin root directory. If no icon is available Movian Showtime will use a placeholder image instead.
h3. description (OPTIONAL)
Long rich-text formatted description of the plugin.
Plugins for Movian Showtime are currently written in ECMAScript.
*Since 2010 Movian Showtime Media Center have been using SpiderMonkey 1.8.0-rc as JavaScript engine. However, SpiderMonkey planning to be phased out and be fully replaced with the engine called Duktape (http://duktape.org). Currently (beginning from v4.8) Movian Showtime Media Center contains both engines. Most of the features are compatible and a special document will be crafted on how to port plugins to from SpiderMonkey JavaScript to Duktape ECMAScript.*
This document assumes the reader has good understanding of ECMAScript. There are plenty of books and sites on the subject so in this document is not going to waste space or time on teaching the ECMAScript language itself.
The Movian Showtime Media Center plugins do not interact directly to the user via the user interface (similar to a web browser) but rather respond to browse and search requests and populate the internal data model with information that is then presented to the user via Movian's Showtime's user interface(s).
h1. Structure of a plugin
Each plugin resides in a directory of it's own. This directory must contain a file *plugin.json* which contains information about the plugin. For more information about this file, please see the section named plugin.json below.
Apart for the plugin.json file there are no further restrictions of what the files are named in the plugin directory or if files are placed in sub-directories, etc
h2. plugin.json
plugin.json is a JSON (http://www.json.org/) encoded text file
containing information about the plugin
Example of a plugin.json file (from the Headweb plugin):
<pre><code class="javascript">
{
"type": "ecmascript",
"apiversion": 1,
"id": "headweb",
"file": "headweb.js",
"showtimeVersion": "4.1.22",
"version": "1.5.3",
"author": "Andreas Öman",
"title": "Headweb",
"icon": "headweb_square.png",
"synopsis": "Headweb online video",
"category": "video",
"description": "<p>Headweb is a Swedish online video store.<p>For more information, visit <a href=\"http://www.headweb.com\">http://www.headweb.com</a>",
"homepage":"https://github.com/andoma/showtime-plugin-headweb"
}</code></pre>
Description of fields and requirement of their presence:
h3. type (REQUIRED)
Type of plugin, as described by the following list.
* @[email protected] - Loads the plugin using Duktape.
* @[email protected] - *(deprecated)* Loads the plugin into the SpiderMonkey engine. This is planned to be removed in Movian 4.10 Showtime 5.0 so any use is discouraged.
* @[email protected] - used for on screen keyboard plugin
h3. apiversion (OPTIONAL)
Only applicable if type is @[email protected], ie. when running using the Duktape engine. This controls the API exposed by Movian showtime to the plugin.
* 1 - The version 1 API is _mostly_ compatible with the API exposed through the SpiderMonkey engine.
* 2 - The version 2 API is a new API which more resembles modern ECMAScript using modules and CommonJS interfaces. Please try to use this.
The version 1 API is emulated using the version 2 API using JavaScript wrappers. The emulation code can be found here https://github.com/andoma/showtime/blob/master/resources/ecmascript/legacy/api-v1.js
h3. id (REQUIRED)
Unique identifier for a plugin. The IDs are assigned by the Movian Showtime project. Any ID starting with the string "test" is reserved for development and can be used by plugin developers until a final ID has been assigned. The assigned IDs will be ASCII lowercase. To get an ID please mail [email protected]
h3. file (REQUIRED)
Name of the plugin executable/script. Usually it's a good idea to give the file a name resembling the plugin ID.
h3. title (RECOMMENDED)
Short title of the Plugin. If omitted the 'id' field will be used instead which might look a bit bad due to lowercasing, etc
h3. showtimeVersion (RECOMMENDED)
Minimum version required of Movian Showtime for this plugin to work. If the current version of Movian Showtime is less than this version the user won't be able to install the plugin but will be notified about what version
of Movian Showtime is required. The same goes if a plugin is updated and the new version requires a newer version of Movian. Showtime. Then the user will be refused to upgrade the plugin. If this field is omitted Movian Showtime will assume the plugin works on all versions of Movian. Showtime.
h3. version (RECOMMENDED)
Version of the plugin. If this does not match the current installed version of a user's plugin the user will be presented with the possibility to upgrade the plugin. If the field is omitted Movian Showtime will set the version to "Unknown"
h3. category (RECOMMENDED)
Category of the plugin. If the field is omitted Movian Showtime will set the category to "Unknown". Following categories are known:
"tv" - online TV
"video" - streaming video
"music" - streaming music
"glwview" - UI extentions
"subtitles" - subtitles
"glwosk" - on screen keyboard
h3. synopsis (RECOMMENDED)
A short one line summary of the plugin or the service it accesses
h3. author (OPTIONAL)
Plugin developer. Any UTF-8 characters are valid.
h3. homepage (RECOMMENDED)
An URI with the location of the plugin homepage
h3. icon (OPTIONAL)
Path to plugin icon. The path is relative to the plugin root directory. If no icon is available Movian Showtime will use a placeholder image instead.
h3. description (OPTIONAL)
Long rich-text formatted description of the plugin.