Architecture of Metadataplayer

WARNING ! This documentation refers to the latest version of Metadataplayer, available in the default branch in our repository http://www.iri.centrepompidou.fr/dev/hg/metadataplayer

External Libraries

External libraries are bundled in the src/libs directory

LAB.js

jQuery

jQuery UI

Underscore

Popcorn

Mustache

Raphael

ZeroClipboard

ktbs4js Tracemanager

Metadataplayer core

In Metadataplayer, Javascript and CSS files are divided in core and widgets.

In the release (compiled) version, the JS part of the core is a single file, LdtPlayer-core.js compiled by concatenating JS files located dans src/js:

header.js

Contains credits and licence information (The license is CEA, CNRS and Inria’s CeCILL-C)

LAB.js

see external libraries.

init.js

Defines the IriSP object, used as a namespace for the whole Metadataplayer. Contains the declaration and methods of the IriSP.Metadataplayer class, whose instantiation is the main entry point for the code.

pop.js

Defines the IriSP.PopcornReplacement class, i.e. a simplified version of the Popcorn API used to interface with video players (jwplayer, dailymotion) not supported by Popcorn. When this part of the Metadataplayer was written, Popcorn and jwplayer didn’t interface well, but it should be replaced by a real Popcorn.js plugin.

utils.js

Contains some utility functions such as IriSP.loadCss, an equivalent to LAB.js for CSS files.

model.js

Contains classes managing the Cinelab data model, grouped in the IriSP.Model namespace.

widgets.js

Contains the (abstract) class IriSP.Widgets.Widget, containing base functionalities for all widgets.

players

Files in this directory interface Popcorn Replacement (see pop.js) with third-party video players.

Five players are available:

  1. player.jwplayer, for JwPlayer, used to play RTMP streams on the Ligne de temps platform.
  2. player.dailymotion, to play videos on Dailymotion.
  3. player.allocine, to play videos on allocine.net
  4. player.mashup, for the flash based mashup player written by Thibaut Cavalié.
  5. player.htmlMashup, for the Popcorn-based HTML5 mashup player.

serializers

Serializers are converters between the internal data representation in the metadata player and formats used for communication with servers.

Two serializers are available:

  1. ldt, to read JSON projects provided by the Lignes de Temps platform.
  2. ldt_annotate, for communications with the Add Widget API, whose format is slightly different.

Widgets

Widgets are modules, visible or not, adding functionalities to the Metadataplayer.

Located in the src/widgets directory, they’re composed of a mandatory JavaScript file, WidgetName.js and an optional stylesheet, WidgetName.css

Common Widget Options

Here’s a list of available widgets:

Annotation

AnnotationsList

Arrow

Controller

CreateAnnotation

HelloWorld

Media

Mediafragment

Polemic

Renkan

Segments

Slider

Social

Sparkline

Tagcloud

Tooltip

Trace

Tweet