NPO Player Client Library



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(
            'baseUrl' => ''

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


Send any question about this package to