Skip to content

Annoto/playkit-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

78 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PlayKit JS Annoto - plugin for the [PlayKit JS Player]

PlayKit JS Annoto plugin is written in Typescript.

Getting Started

Prerequisites

The plugin requires Kaltura Player to be loaded first.

Installing

Clone and run npm to install dependencies:

git clone https://github.com/Annoto/playkit-plugin.git
cd playkit-plugin
npm install

Building

To build the player for production run:

npm run build

Developing

To start developing run:

npm run dev

Embed the plugin in your test page

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>

Contributing

Please read CONTRIBUTING.md for details.

Versioning

We use SemVer for versioning. For the versions available, see the releases on this repository.

License

This project is licensed under the Apache 2.0 License License - see the LICENSE file for details.