PHP code example of bytelus / nowplaying

1. Go to this page and download the library: Download bytelus/nowplaying 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/ */

    

bytelus / nowplaying example snippets



// Example PSR-17 and PSR-18 implementation from Guzzle 7
// Install those with:
//   composer    new \Http\Factory\Guzzle\RequestFactory,
    new \GuzzleHttp\Client
);

$adapter = $adapterFactory->getAdapter(
    \NowPlaying\Adapter\AdapterFactory::ADAPTER_SHOUTCAST2,
    'http://my-station-url.example.com:8000',
    'AdminPassword!' // Optional
);

// The first argument to the functions is the mount point or
// stream ID (SID), to pull one specific stream's information.
$now_playing = $adapter->getNowPlaying('1');

$clients = $adapter->getClients('1');