\HlsTV
OmegaTV low-level API implementation
Synopsis
class HlsTV
{
- // constants
- const URL_API = 'https://api.hls.tv/';
- const LOG_PATH = 'exports/omegatv.log';
- const OPTION_PUBLIC = 'OMEGATV_PUBLIC_KEY';
- const OPTION_PRIVATE = 'OMEGATV_PRIVATE_KEY';
- // members
- protected array $altCfg = ;
- protected string $publicKey = '';
- protected string $privateKey = '';
- protected integer $currentTimeStamp = 0;
- protected bool $debug = false;
- // methods
- public void __construct()
- protected void loadConfigs()
- protected void setOptions()
- protected string generateApiHash()
- public array/json pushApiRequest()
- public array getTariffsPromo()
- public array getTariffsBase()
- public array getTariffsBundle()
- public array getUserInfo()
- public array setUserTariff()
- public array setUserBlock()
- public array setUserActivate()
- public array getDeviceCode()
- public array deleteDevice()
- public array addDevice()
- public array getDeviceList()
- public array addPlayList()
- public array deletePlayList()
Constants
Name | Value |
---|---|
URL_API | 'https://api.hls.tv/' |
LOG_PATH | 'exports/omegatv.log' |
OPTION_PUBLIC | 'OMEGATV_PUBLIC_KEY' |
OPTION_PRIVATE | 'OMEGATV_PRIVATE_KEY' |
Members
protected
- $altCfg
—
array
Contains system alter config as key=>value - $currentTimeStamp
—
int
Current timestamp for all API requests - $debug
—
bool
Debug flag - $privateKey
—
string
Contains private key - $publicKey
—
string
Contains public key
Methods
protected
- generateApiHash() — Returns new API_HASH for some message
- loadConfigs() — Loads required configs into protected properties for further usage
- setOptions() — Sets default options to object instance properties
public
- __construct() — Creates new low-level API object instance
- addDevice() — Adds user device
- addPlayList() — Assigns new playlist to some customer
- deleteDevice() — Removes user device
- deletePlayList() — Deletes playlist by its uniq
- getDeviceCode() — Returns user device activation code
- getDeviceList() — Returns list of all devices of company
- getTariffsBase() — Returns list of main tariffs
- getTariffsBundle() — Returns list of bundle tariffs
- getTariffsPromo() — Returns list of promo tariffs
- getUserInfo() — Get all user info.
- pushApiRequest() — Pushes some request to remote API and returns decoded array or raw JSON reply.
- setUserActivate() — Sets user as unblocked
- setUserBlock() — Sets user as blocked
- setUserTariff() — Sets base tariff or some additional tariffs