kro-ncrv/npoplayer

NPO Player Client Library


License
MIT

Documentation

NPO Player client library README

This package provides an easy way embed the NPO Player on your website.

What is this repository for?

The purpose of this package is to help web developers to use the Player provided by the NPO on their website.

How do I get set up?

First, add the package to composer:

composer require kro-ncrv/npoplayer

Then, create an instance of class NPOPlayer/Client with the provided API key and, if necessary, extra options.

    $client = new NPOPlayer\Client(
        'e45fe473feaf42ad9a215007c6aa5e7e',
        [
            'baseUrl' => 'https://player.it-labs.nl'
        ]
    )

After you have an instance you can execute the getEmbedCode function to retrieve a block with a script element to include in your template:

    $embedCode = $client->getEmbedCode(
        'KN_1688563', // Media ID
        'player', // ID of DIV element to put player in
        ['autoplay' => true] // Extra options for player
    ); 

You can find a working example in tests/test.php

Questions?

Send any question about this package to webstudio@kro-ncrv.nl