Constructor
new module:ct-sljsadapter /watchlist /Stream Link Watchlist Contents Manager()
- Implements:
Methods
append(subjects, erroropt, successopt)
Appends a list of records to the end of the watchlist's list. Makes streamlink contrib to add records to the end of this watchlist and add the request to list of pending requests. Calls success when streamlink adds all the requested records. If all the records have not been added after the timeout, error is called.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
subjects |
Array |
the array of subjects to add. |
|
error |
function |
<optional> |
function to be called if operation fails |
success |
function |
<optional> |
function to be called if operation succeeds |
- Implements:
- See:
Throws:
-
If the contents manager is paused or destroyed.
contains(subject) → {Boolean}
Determines whether or not this watchlist contains the given subject.
Parameters:
Name | Type | Description |
---|---|---|
subject |
string | Subject to verify |
Throws:
-
If the contents manager is paused or destroyed.
Returns:
true if the given subject is in this watchlist, otherwise false.
- Type
- Boolean
destroy()
This method should be called when this contents manager will no longer be used.
Throws:
-
If the contents manager is already destroyed.
get Contents()
Return watchlist contents
insert(subjects, index, erroropt, successopt)
Inserts a list of records at the given index into the watchlist. Makes streamlink contrib to insert records into this watchlist and add the request to list of pending requests. Calls success when streamlink adds the requested subject; or if all the records have not been added after the timeout, error is called.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
subjects |
Array |
the array of subjects to add. |
|
index |
number | where the records should be inserted. Must be a non-infinite, positive integer. |
|
error |
function |
<optional> |
function to be called if operation fails |
success |
function |
<optional> |
function to be called if operation succeeds |
- Implements:
- See:
Throws:
-
If the contents manager is paused or destroyed.
is Paused() → {boolean}
Is the contents manager actively subscribed
Throws:
-
If the contents manager is destroyed.
Returns:
true if the contents manager subscription is paused, otherwise false.
- Type
- boolean
pause()
Change the state of this object to paused, and remove it from the list of active contents managers. When no more contents managers are actively using a Watchlist, the subscription to the watchlist container subject will be stopped. If already paused, do nothing. Your component should call this method when it is hidden.
Throws:
-
If the contents manager is already destroyed.
remove(subjects, erroropt, successopt)
Removes a list of records from the watchlist. Makes streamlink contrib to remove records from this watchlist and add the request to list of pending requests. Calls success when streamlink removes all the requested records; or if all the records have not been removed after the timeout, error is called.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
subjects |
Array |
the array of subjects to remove. |
|
error |
function |
<optional> |
function to be called if operation fails |
success |
function |
<optional> |
function to be called if operation succeeds |
- Implements:
- See:
Throws:
-
If the contents manager is paused or destroyed.
resume()
Change the state of this object to unpaused, and add it to the watchlist's list of active contents managers. If no contents managers were previously using a watchlist, a subscription to the watchlist container subject will be started. If already unpaused, do nothing.
Your component should call this method when it is unhidden.
Throws:
-
If the contents manager is already destroyed.