Getting Started

circle-check

Setup

The player is officially available via CDN and npm. Annoto works out of the box with not only HTML <script> tag, but also with all major bundlers/packagers/builders, such as Browserify, WebPack, etc.

$ npm install @annoto/player
circle-info

The package includes full typings and can be used in typescript/ES6/flow projects.

Creating a Player

Annoto player is exposed as UMD modulearrow-up-right, meaning it offers compatibility with the most popular script loaders and can be imported as commonjs/amd/es6. If you are not using any standard loader the player will be exposed on window as global variables.

circle-info

If you are using a javascript module loader such as RequireJS. Annoto exposes a standard UMDarrow-up-right. For example for requireJS:

requirejs(["https://player.annoto.net/index.js"], function(nn) {
    //
});

The main player class is AnnotoPlayerarrow-up-right. After you have the player instance it can be used to load video sources, dynamically control Widget, get access to Widget API and much more.

Creating player using the annotoPlayer helper (CDN)

circle-info

The annotoPlayer() helper is available only for the CDN. When using the npm package, please use the AnnotoPlayer constructor directly (see below)

The simplest way to create a player is using the annotoPlayer() methodarrow-up-right:

Creating player using the AnnotoPlayer constructor

The Player instance can be created using the AnnotoPlayerarrow-up-right constructor which allows the most flexibility:

Player Options

Annoto Player extends standard VideoJS optionsarrow-up-right with some advanced functionality, for more details, please refer to the PlayerOptionsarrow-up-right.

circle-check

Using the Widget API

The most common widget related api is available directly via the AnnotoPlayerarrow-up-right instance, for example: setupWidget, loadWidget, destroyWidget.

For more advanced usages the IAnnotoApiarrow-up-right can be obtained using await player.getWidgetApi()

Authenticating the User

The most recomended wait is to provide the User's SSO token to the widget configuration as show in Creating A Player.

An alternative way is to authenticate the user dynamically Using the Widget API

Last updated