All Projects → AzuraCast → nowplaying

AzuraCast / nowplaying

Licence: Apache-2.0 license
A lightweight PHP adapter for viewing the current now playing data in Icecast and SHOUTcast 1/2. A part of the AzuraCast software suite.

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to nowplaying

player-shoutcast-html5
Responsive HMTL5 Web Player for SHOUTCast and Icecast streamings with cover art and lyrics
Stars: ✭ 71 (+255%)
Mutual labels:  icecast, shoutcast, web-radio
fridgefm-radio-core
Simple lightweight package for creating your own radio station via NodeJS heavily inspired by Shoutcast and Icecast.
Stars: ✭ 32 (+60%)
Mutual labels:  icecast, shoutcast
goicy
AAC and MPEG (MP1, MP2, MP3) Icecast/Shoutcast source client written in Go
Stars: ✭ 58 (+190%)
Mutual labels:  icecast, shoutcast
obplayer
📻 OBPlayer Streaming Automation Playout with CAP EAS Alerting
Stars: ✭ 93 (+365%)
Mutual labels:  icecast, shoutcast
icecast-parser
Node.js module for getting and parsing metadata from SHOUTcast/Icecast radio streams
Stars: ✭ 66 (+230%)
Mutual labels:  icecast, shoutcast
AzuraRelay
A "relay in a box" containing a lightweight web application and Icecast servers that can connect to and relay an AzuraCast parent instance.
Stars: ✭ 20 (+0%)
Mutual labels:  icecast, webcasting
radiobot
Your hobbyist radio station solution.
Stars: ✭ 17 (-15%)
Mutual labels:  shoutcast
SHOUTcast-Manager
[DEPRECATED] NO LONGER MAINTAINED - A PHP SHOUTcast hosting tool with support for PHP 5.x & 7.x with SHOUTcast v1 & v2)
Stars: ✭ 24 (+20%)
Mutual labels:  shoutcast
Azuri
No longer maintained; see community fork in README.
Stars: ✭ 15 (-25%)
Mutual labels:  azuracast
jsCast
📻 An Audio Streaming Application written in JavaScript
Stars: ✭ 23 (+15%)
Mutual labels:  icecast
supbox
Get the currently playing track from Rekordbox v6 as Audio Hijack Shoutcast/Icecast metadata, display in your OBS video broadcast or export as JSON.
Stars: ✭ 36 (+80%)
Mutual labels:  shoutcast
morganfreeman
A simple analytics for icecast servers
Stars: ✭ 14 (-30%)
Mutual labels:  icecast

NowPlaying

NowPlaying is a lightweight, modern, object-oriented PHP library that abstracts out the currently playing metadata from popular radio broadcast software into a single common return format.

Installing

NowPlaying is a Composer package that you can include in your project by running:

composer require azuracast/nowplaying

Compatibility

Now Playing data Detailed client information
Icecast (2.4+)
SHOUTcast 2
SHOUTcast 1

Usage Example

<?php
// Example PSR-17 and PSR-18 implementation from Guzzle 7
// Install those with:
//   composer require guzzlehttp/guzzle:^7 http-interop/http-factory-guzzle

$adapterFactory = new NowPlaying\AdapterFactory(
    new Http\Factory\Guzzle\UriFactory,
    new Http\Factory\Guzzle\RequestFactory,
    new GuzzleHttp\Client
);

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

// You can also call:
// $adapterFactory->getShoutcast2Adapter('http://url');

// Optionally set administrator password
$adapter->setAdminUsername('admin'); // "admin" is the default
$adapter->setAdminPassword('AdminPassword!');

// 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');

Example "now playing" response (PHP objects represented in JSON):

{
  "currentSong": {
    "text": "Joe Bagale - Until We Meet Again",
    "title": "Until We Meet Again",
    "artist": "Joe Bagale"
  },
  "listeners": {
    "total": 0,
    "unique": 0
  },
  "meta": {
    "online": true,
    "bitrate": 128,
    "format": "audio/mpeg"
  },
  "clients": []
}

Example "clients" response:

[
  {
    "uid": 1,
    "ip": "127.0.0.1",
    "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.81 Safari/537.36",
    "connectedSeconds": 123
  }
]
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].