kro-ncrv / mediasync
Media Sync
This package has no released version yet, and little information is available.
README
This package provides an easy way to connect your application to the POMS-API.
What is this repository for?
The purpose of this package is to help web developers to use the API provided by the NPO to synchronize seasons, episodes, fragments, clips of television shows to the corresponding website.
How do I get set up?
First, add the package to composer:
composer require kro-ncrv/mediasync
Then, create a class that provides interface MediaSync/StoreMediaInterface and implement functions for logging and saving entities. For example:
class StoreMediaExample implements StoreMediaInterface
{
/**
* @inheritdoc
*/
public function log($line)
{
// write line to logger
}
/**
* @inheritDoc
*/
public function saveSeason(Season $season)
{
// store season (for example in database)
}
...
After this you can create a cronjob or trigger to start the synchronisation with your storage class and API settings like this:
$mediaSync = new \MediaSync\MediaSync(
new StoreMediaExample(),
[
'npo_api_key' => '[provided api key]',
'npo_api_secret' => '[provided api secret]',
'npo_api_origin' => 'https://kro-ncrv.nl' // For example
]
);
$mediaSync->syncSeries('[media id of series]');
Endpoints
De MediaSync class provides the following endpoints:
1) syncSeries(string $mediaId)
Syncs all the seasons of the series with the given POMS Media ID.
2) syncSeason(string $mediaId)
Syncs all the episodes of the season with the given POMS Media ID.
3) syncEpisode(string $mediaId)
Syncs the episode with the given POMS Media ID (including segments, clips and promo's).
Questions?
Send any question about this package to webstudio@kro-ncrv.nl