PHP code example of lezhnev74 / hls-monitor
1. Go to this page and download the library: Download lezhnev74/hls-monitor library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
lezhnev74 / hls-monitor example snippets
$playlists = [...many playlists to check...];
$failed_reports = [];
// for each given playlist - make checking
$output = [];
$return_code = 0;
exec('vendor/bin/hls-monitor playlists '.implode(",",$playlists), $output, $return_code);
if($return_code) {
// there were problems with this palylist
$failed_reports[] = $output;
}
// then report if anything is not good
if(count($failed_reports)) {
// mail reports to somewhere
}