Documentation

SpotPlayer
in package

Table of Contents

Methods

checkCookie()  : bool
Check if the cookie is still valid.
generateCookie()  : array<string|int, mixed>
Generating cookie.
getAllCourses()  : array<string|int, mixed>
Get All the courses for a license.
getAllLicences()  : array<string|int, mixed>
Get all licenses.
getCourseDetail()  : array<string|int, mixed>
Get the detail for one course.
getJSONFileList()  : array<string|int, mixed>
Get files as JSON.
getLicenseData()  : array<string|int, mixed>
Get a licence description.
licence()  : array<string|int, mixed>
generate a spotplayer licence for the given values.
setDevice()  : array<string|int, mixed>
To set up the $device array in a convinient way.
updateLicense()  : string
Update a spotplayer licence for the given values.
filter()  : array<string|int, mixed>
Ommit all null values from the options array.
request()  : array<string|int, mixed>
Setting up request to send to api end point.

Methods

checkCookie()

Check if the cookie is still valid.

public checkCookie(string $cookie) : bool
Parameters
$cookie : string

The cookie to check it's validity

Return values
bool

The cookie validity.

generateCookie()

Generating cookie.

public generateCookie(string $cookie) : array<string|int, mixed>
Parameters
$cookie : string
Return values
array<string|int, mixed>

Use the second element of the array as the cookie value.

getAllCourses()

Get All the courses for a license.

public getAllCourses() : array<string|int, mixed>
Return values
array<string|int, mixed>

A list of all classes defined in spotplayer with with api key.

getAllLicences()

Get all licenses.

public getAllLicences() : array<string|int, mixed>
Return values
array<string|int, mixed>

A list of all the licences generated with this api key.

getCourseDetail()

Get the detail for one course.

public getCourseDetail(string $courseId) : array<string|int, mixed>
Parameters
$courseId : string
Return values
array<string|int, mixed>

Get the Detail of a specific course.

getJSONFileList()

Get files as JSON.

public getJSONFileList(string $url) : array<string|int, mixed>

Retrieves the materials of a course.

Parameters
$url : string

the downloadable url which is generated when you create a license.

Return values
array<string|int, mixed>

A list of all the content for a course in spotplayer.

getLicenseData()

Get a licence description.

public getLicenseData(string $licenseId) : array<string|int, mixed>
Parameters
$licenseId : string
Return values
array<string|int, mixed>

Get the detail of a licence.

licence()

generate a spotplayer licence for the given values.

public licence(string $name, array<string|int, mixed> $courses, mixed $watermarks[, mixed $device = null ][, mixed $payload = null ]) : array<string|int, mixed>
Parameters
$name : string

the name of the person this licence should issued to.

$courses : array<string|int, mixed>

the courses that this licence covers.

$watermarks : mixed
$device : mixed = null
$payload : mixed = null
Return values
array<string|int, mixed>

The array consists of these keys:

  • _id Created License ID,
  • key License Key,
  • url downloadable licence speciefic url (extending https://dl.spotplayer.ir/, ends with file type).

setDevice()

To set up the $device array in a convinient way.

public setDevice(int $numberOfAllowedActiveDevices[, int $Windows = 0 ][, int $MacOS = 0 ][, int $Ubuntu = 0 ][, int $Android = 0 ][, int $IOS = 0 ][, int $WebApp = 0 ]) : array<string|int, mixed>

If you wish to set up a specific device set up for a licence you can use this function to create the array in a conviniet way.

Parameters
$numberOfAllowedActiveDevices : int
$Windows : int = 0

default value: 0

$MacOS : int = 0

default value: 0

$Ubuntu : int = 0

default value: 0

$Android : int = 0

default value: 0

$IOS : int = 0

default value: 0

$WebApp : int = 0

default value: 0

Tags
see

config('spotplayer.device') Read the doc on package config file for more information.

Return values
array<string|int, mixed>

The device array to use in licence generation.

updateLicense()

Update a spotplayer licence for the given values.

public updateLicense(mixed $licenseId, string $name, array<string|int, mixed> $data, array<string|int, mixed> $device) : string
Parameters
$licenseId : mixed
$name : string

the name of the person this licence should issued to.

$data : array<string|int, mixed>

the data of the video including licence limits.

$device : array<string|int, mixed>

specifies which device is covered with this licence.

Return values
string

The id of the licence which was affected by the update.

filter()

Ommit all null values from the options array.

private filter(array<string|int, mixed> $a) : array<string|int, mixed>
Parameters
$a : array<string|int, mixed>

the array to get filtered.

Return values
array<string|int, mixed>

The filtered array.

request()

Setting up request to send to api end point.

private request(string $url[, array<string|int, mixed> $options = null ]) : array<string|int, mixed>
Parameters
$url : string

the endpoint to sent the request to.

$options : array<string|int, mixed> = null

the options of the request.

Return values
array<string|int, mixed>

The response sent back from the api end point.


        
On this page

Search results