PluginOverview » History » Version 3

« Previous - Version 3/26 (diff) - Next » - Current version
Leonid Protasov, 01/03/2014 10:06 AM


Overview

Plugins for Showtime are currently written in JavaScript. The JavaScript engine inside Showtime is SpiderMonkey 1.8.0-rc1. Note that Showtime does not implement the same JavaScript API as normal web browsers. The basic JavaScript is there but there is no such thing as a DOM or AJAX, etc.

This document assumes the reader has good understanding of JavaScript. There are plenty of books and sites on the subject so I don't want to waste space or time on teaching JavaScript.

The Showtime plugins do not interact directly to the user via the user interface (similar to a web browser) but rather it responds to browse and search requests and populate the internal data model with information that is then presented to the user via Showtime's user interface(s).

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

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):

{
  "type": "javascript",
  "id": "headweb",
  "file": "headweb.js",
  "showtimeVersion": "3.1",
  "version": "1.0",
  "category": "",
  "author": "Andreas Öman",
  "homepage": "",
  "title": "Headweb",
  "icon": "headweb_square.png",
  "synopsis": "Headweb online 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>" 
}

Description of fields and requirement of their presence:

type (REQUIRED)

Type of plugin, currently only "javascript" is supported.

id (REQUIRED)

Unique identifier for a plugin. The IDs are assigned by the 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

file (REQUIRED)

Name of the plugin executable/script. Usually it's a good idea to give the file a name resembling the plugin ID.

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

showtimeVersion (RECOMMENDED)

Minimum version required of Showtime for this plugin to work. If the current version of Showtime is less than this version the user won't be able to install the plugin but will be notified about what version
of Showtime is required. The same goes if a plugin is updated and the new version requires a newer version of Showtime. Then the user will be refused to upgrade the plugin. If this field is omitted Showtime will assume the plugin works on all versions of Showtime.

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 Showtime will set the version to "Unknown"

category (RECOMMENDED)

Category of the plugin. If the field is omitted Showtime will set the category to "Unknown". Following categories are known:
"TV" - online TV
"video" - streaming video
"glwview" - UI extentions
"subtitles" - subtitles

synopsis (RECOMMENDED)

A short one line summary of the plugin or the service it accesses

author (OPTIONAL)

Plugin developer. Any UTF-8 characters are valid.

homepage (RECOMMENDED)

A URI with the location of the plugin homepage

icon (OPTIONAL)

Path to plugin icon. The path is relative to the plugin root directory. If no icon is available Showtime will use a placeholder image instead.

description (OPTIONAL)

Long rich-text formatted description of the plugin.