Web-based Hypervideo Syntax

The CHM language specification is implemented as an extension above the HTML language. CHM namespaced attributes are associated to standard HTML elements, and extend them with CHM specification behaviors. Such behaviors are handled by a set of JavaScript libraries to perform a content transformation to dynamically generate  HTML code, readable and understandable by modern browsers. 

The CHM spatial model is supported by the indirect HTML layout model via cascading stylesheets (CSS) and container elements like DIV, while SMIL Timesheets implementation handles the document time and the synchronization model.


Preambles for Using the Libraries

CHM Namespace

The augmented HTML syntax refers to a unique namespace:
<html xmlns:chm="http://www.advene.org/ns/chm">

Including the librairies

WebCHM is developped using the JQuery framework and uses many related widgets, contained within the chm.api directory:
<html xmlns:chm="http://www.advene.org/ns/chm">
<script src="./chm.api/timeline/timeline_ajax/simile-ajax-api.js?bundle=true" type="text/javascript"/>
<script src="./chm.api/timeline/timeline_js/timeline-api.js?bundle=true" type="text/javascript"/>
<script type="text/javascript" src="./chm.api/res/jquery.js"/>
<script type="text/javascript" src="./chm.api/res/jqueryui.js"/>
<script src="chm.api/jquery.tmpl.js" type="text/javascript" charset="utf-8"/>
<script type="text/javascript" src="./chm.api/mediaelement.js"/>
<script type="text/javascript" src="./chm.api/chm.api.js"/>

<link type="text/css" href="./chm.api/res/theme/jqueryui.css" rel="stylesheet"/>
<link href="./chm.api/res/style.css" rel="stylesheet" type="text/css">

Hypervideo Content Declaration

The content declaration is performed using the HTML+CHM syntax in a declarative manner. The WebCHM libraries then perform a content transformation to generate pure HTML code interpreted by almost all browsers.

Hypervideo container elements

A component declaration requires to associate the chm:component attribute to a HTML container element like div

<div chm:component  =  "component_name"... >

The value of this attribute defines the component type. The available values are:

Hypervideo components attributes

Most of these components share a set of CHM attributes.An attribute can have different meanings from one component to another.

<div chm:component  =  "component_name" id='IDF" [chm:attribute = "VALUE"]... >

The main attributes are presented on the following table:

id
Unique identifier of the component
chm:src
Source of the data. For a data reader, the identifier of the reader.
chm:filter
The filter used to query the data reader
chm:timelineref
The identifier of the TimedMedia used as the time reference
chm:content
The content to display when data is received from the reader
chm:param
Extra parameters to apply to the component, when used


Hypervideo Annotations

CHM is an annotation-driven model and thus, for the design of a hypervideo, an annotation structure is required. For instance, an annotation structure performed by Advene and exported into JSon has the following form:

[...]
{
"id": "a1",
"type": "shots",
"media": "TimBerners-Lee_2009.mp4",
"begin": 0,
"end": 2000,
"content": "num=0"
},

{
"id": "a2",
"type": "shots",
"media": "TimBerners-Lee_2009.mp4",
"begin": 2000,
"end": 2333,
"content": "num=1"
},

{
"id": "a3",
"type": "shots",
"media": "TimBerners-Lee_2009.mp4",
"begin": 2333,
"end": 4083,
"content": "num=2"
},

{
"id": "a4",
"type": "shots",
"media": "TimBerners-Lee_2009.mp4",
"begin": 4083,
"end": 4124,
"content": "num=3"
},



[...]

The displayed document content is accessed through dedicated readers that fetch the appropriate content in response to components queries.

<!-- JSon format Annotation Reader -->
<div chm:component="jsonreader" id="data" chm:src="Tim.json"/>
<!!-- Annotation Reader from wikipedia.org-->
<div chm:component="annotationreader" id="wiki" chm:src="http://en.wikipedia.org/w/api.php?action=parse&props=text&page="/>
The id attribute allows other components to use this as a data source. The chm:src attribute gives the absolute or relative path to the annotation file. For a generic annotation reader, this gives the source of the data provider.

Hypervideo Links

Hypervideo links are attributes of anchors. A hypervideo anchor or hotspot is declared as any plain component supplemented with particular behavioral attributes. Hypervideo links are links with at least one anchor set to a spatio-temporal region of a continuous media. Such region or anchor is called Hotspot.

To address a video fragment, we make use of the W3C Media Fragment by implementing a subset of its specification related to temporal fragments identification. The spatial part is handled by the proper annotation content definition. Hence, the following specifications are possible:

	chm : href = "hotspotID";
chm : href = "componentID#t=.120";
chm : href = "componentID#t=.120,1.230";
chm : href = "http://www.exemple.com/video.mp4#t=.120,1.230";

Hypervideo Rendering Components

VideoPlayer and TimedMedia

A hypervideo contains at least a TimedMedia that contains the audiovisual stream which will be rendered within a player component.

<!-- VideoPlayer+TimedMedia -->
<div chm:component="videoplayer" id="tm" chm:src="MyAnnotatedVideo.mp4"/>
The id attribute allow the components to use this as a timeline reference. The chm:src gives the absolute or relative path to the video file.

TextViewer

The hypervideo components are declared using the CHM syntax which specifies which TimedMedia to use as a time reference and which data reader to query.
<div id='discours' chm:component='textviewer' chm:timelineref='tm' chm:src='data' chm:filter="type=='Transcript'" />

RichTextViewer

The following example illustrates the use of more than one data reader to pull content from the annotation structure plus an online resource (Wikipedia).
<div id="concepts" chm:component='richtextviewer' chm:timelineref='tm'
chm:src='wiki' chm:target='data' chm:filter="type=='Terms'"
chm:param="wiki.page={name}"" />

The chm:target attribute is used within this component to use the data sent by the data reader data as input for the data reader wiki.

ImageViewer

The following code illustrates how to declare an image viewer
<div chm:component='imageviewer' chm:timelineref="tm" 
chm:src='data' chm:filter="type=='episode'"
chm:content="imagescache/${begin}.png" >  

Caption

Captions can be used to display textual content over the video player. For instance, the following code illustrates how to use this component
<div chm:component="caption" chm:src="data" chm:filter="type=='subtitle'" 
chm:content="${content}" chm:timelineref="tm" >  

Transcript

 A transcript is a text generated from a textual transcription of the audiovisual document, that allows to navigate from the transcription to the corresponding time in the video, and possibly highlights in some way the text that corresponds to the video fragment being played. For instance, the following code illustrates how to use this component
<div chm:component="transcript" chm:src="data" chm:filter="type=='Transcript'" 
chm:content="${content}" chm:timelineref="tm" >  

Hotspot

A hotspot can be instanciated like follows:

<div chm:component='hotspot' chm:src='data' chm:filter="type=='gotoLink'"
chm:src='data' chm:target='_blank' />

Table of Contents

A hypervideo table of content gives a flat or hierarchical representation index of the main audiovisual following features expressed as annotations or annotation types.

<div id="test" chm:component='toc' chm:src='data'
chm:filter="type=='Parts'" />

Map

A map is an index of graphical representations of some audiovisual features expressed by annotations and/or annotation types. A map may present these features as shots, text, clips and video previews, etc.
<div  id="shots" chm:component='map' chm:src='data'
chm:filter="type=='shot'"
chm:screenshot="true"/>

The chm:screenshot when placed to true allows the instanciate a graphical map made of screenshots. When false, the result is a textual map.

Timeline + Track

A timeline is a visual interactive representation of the hypervideo time, to spatially place particular features over time in a graphical and chronological representation. For instance, the foolowing code allows to have a timeline with tracks representing actors appearence in a film
<div id='tl' chm:component='timeline'
chm:src='data' chm:filter="type=='Actors'"' />

Status

The authoring process may be eased by a graphic user interface (GUI) environment; this is one of the future development stages. We also want to rely on cognitive theories to propose more meaningful rendering libraries. The interaction possibilities can be enriched by more advanced features like offering additional mechanisms to end-users, readers, annotations.