Developer toolkit for adding annotation to streaming video presentations.
outro.coffeesrc/ | |
---|---|
)(jQuery, MITHgrid, OAC) | |
Default Configurations | |
ApplicationThe Video Annotator core application has the basic set of components needed to provide video annotation. | MITHgrid.defaults "OAC.Client.StreamingVideo.Application", |
Controllers | controllers:
canvas:
type: OAC.Client.StreamingVideo.Controller.CanvasClickController
selectors:
svgwrapper: ''
selectShape:
type: OAC.Client.StreamingVideo.Controller.Select
selectors:
raphael: '' |
Variables | variables: |
ActiveAnnotation holds the item ID of the annotation currently receiving selection focus.
| ActiveAnnotation:
is: 'rwl' |
CurrentTime holds the current position of the video play head in seconds. The value defaults to 0 seconds.
| CurrentTime:
is: 'rw'
"default": 0 |
TimeEasement holds the number of seconds an annotation eases in or out of full view.
| TimeEasement:
is: 'rw',
"default": 5 |
CurrentMode holds the current interaction mode for the annotation client. Values may be a shape type, "Watch", or "Select".
| CurrentMode:
is: 'rw' |
Data Views | dataViews: |
currentAnnotations pages a range of times through the annotation store selecting those annotations which have a time range (.npt_start through .npt_end) that fall within the time range set. | currentAnnotations:
dataStore: 'canvas'
type: MITHgrid.Data.RangePager
leftExpressions: [ '.npt_start' ]
rightExpressions: [ '.npt_end' ] |
Data Store | dataStores: |
canvas holds all of the annotation data for the client. | canvas: |
Types | types: |
All annotation items are of type "Annotation" | Annotation: {} |
Properties | properties: |
The following properties are understood by the annotation client: | |
| bodyContent:
valueType: 'text' |
| bodyType:
valueType: 'text'
|
| npt_end:
valueType: 'numeric' |
| npt_start:
valueType: 'numeric' |
| shapeType:
valueType: 'text'
|
| targetURI:
valueType: 'uri'
|
The following properties are used by the Rectangle and Ellipse shape types: | |
| h:
valueType: 'numeric' |
| targetHeight:
valueType: 'numeric' |
| targetWidth:
valueType: 'numeric' |
| w:
valueType: 'numeric' |
| x:
valueType: 'numeric' |
| y:
valueType: 'numeric'
|
PresentationsWe go ahead and define the overlay that will show the annotation shapes over the video. Any other presentation must be configured outside this application (or as a sub-class). | presentations:
raphsvg:
type: OAC.Client.StreamingVideo.Presentation.RaphaelCanvas
container: ".canvas"
lenses: {}
lensKey: ['.shapeType']
dataView: 'currentAnnotations' |
The controllers are configured for the application and passed in to the presentation's initInstance method as named here. | controllers:
canvas: "canvas" |
View SetupWe create a simple | viewSetup: """
<div class="canvas"></div>
""" |
Component.ShapeCreateBoxInstances of this component will have the following event:
| MITHgrid.defaults "OAC.Client.StreamingVideo.Component.ShapeCreateBox",
bind:
events:
onNewShape: null
|
Component.ShapeEditBoxBy default, this component will have eight handles around the edges of the bounding box and a handle in the center. Instances of this component will have the following events:
| MITHgrid.defaults "OAC.Client.StreamingVideo.Component.ShapeEditBox",
dirs: ['ul', 'top', 'ur', 'lft', 'lr', 'btm', 'll', 'rgt', 'mid']
events:
onResize: null
onMove: null
onDelete: null
onFocus: null
onUnfocus: null |
Controller.CanvasClickControllerBindings created by this controller will have the following events:
| MITHgrid.defaults "OAC.Client.StreamingVideo.Controller.CanvasClickController",
bind:
events:
onShapeStart: null
onShapeDrag: null
onShapeDone: null |
Controller.DragBindings created by this controller will have the following events:
| MITHgrid.defaults "OAC.Client.StreamingVideo.Controller.Drag",
bind:
events:
onFocus: null
onUnfocus: null
onUpdate: null |
Controller.SelectThis controller accepts the Bindings created by this controller will have the following event:
| MITHgrid.defaults "OAC.Client.StreamingVideo.Controller.Select",
bind:
events:
onSelect: null
isSelectable: -> true |
Player.DriverBindingAll driver bindings associating a driver object with a DOM player object have the following events:
| MITHgrid.defaults "OAC.Client.StreamingVideo.Player.DriverBinding",
events:
onResize: null
onPlayheadUpdate: null
|
This project is maintained by umd-mith
Hosted on GitHub Pages — Theme by orderedlist