PlayKit JS Annoto plugin is written in Typescript.
The plugin requires Kaltura Player to be loaded first.
Clone and run npm to install dependencies:
git clone https://github.com/Annoto/playkit-plugin.git
cd playkit-plugin
npm install
To build the player for production run:
npm run build
To start developing run:
npm run dev
To use the plugin, just add plugin bundle script to the page and setup the player:
<script src="https://cdnapisec.kaltura.com/p/2302901/embedPlaykitJs/uiconf_id/50617632"></script>
<!--Kaltura player-->
<script src="https://cdn.annoto.net/playkit-plugin/latest/plugin.js?auto_boot=1"></script>
<!--PlayKit Annoto plugin-->
<div id="kaltura_player_541994816" style="width: 100%; height: 560px;"></div>
<script type="text/javascript">
const config = {
targetId: 'kaltura_player_541994816',
provider: { partnerId: 2302901, uiConfId: 50617632 },
plugins: {
// set the clientId, if not provided, Annoto will load in demo mode
annoto: {
// clientId: 'eyJhbGciOiJIUzI1NiJ9.ZjU4MTMy...',
// manualBoot: true, // to manualy boot the widget or remove auto_boot=1 from the script src
},
}
};
const kalturaPlayer = KalturaPlayer.setup(config);
kalturaPlayer.loadMedia({ entryId: '1_yhp21rlc' });
// To use the annoto api, use the 'annoto' service:
const annotoService = kalturaPlayer.getService('annoto');
// annotoService.boot(); manual boot
annotoService.getApi().then((api) => {
console.info('api: ', api);
});
annotoService.onSetup((setupConfig) => {
console.info('onSetup: ', setupConfig);
});
</script>
Please read CONTRIBUTING.md for details.
We use SemVer for versioning. For the versions available, see the releases on this repository.
This project is licensed under the Apache 2.0 License License - see the LICENSE file for details.