Constructor
new module:caplin/sljsadapter/providers/StreamLinkWatchlistService()
Methods
-
create(name, erroropt, successopt)
-
This method is meant to be invoked by UI components wishing to create a new shareable watchlist. The newly created watchlist will be represented on the front-end by a
module:caplin/sljsadapter/watchlist/StreamLinkWatchlist
. This method submits a contrib to streamlink to create the new watchlist.If the request is successful, an ADDED event will be raised (see
module:caplin/watchlist/WatchlistServiceEvents
) and the newly created watchlist object will be passed. If the requested watchlist has not been created by streamlink after the timeout has elapsed, error will be called.Parameters:
Name Type Attributes Description name
String The presentation name for the watchlist. error
function <optional>
A callback that will be invoked if the request times out. success
module:caplin/sljsadapter/providers/StreamLinkWatchlistService~createSuccessCallback <optional>
A callback that will be invoked when the backend reports that the new watchlist is successfully added. - Implements:
- See:
Throws:
-
If required properties are not included, or if error and success are not functions.
-
dispose(watchlists, erroropt, successopt)
-
A request to dispose of the given watchlists, removing them from the user's list of watchlists.
If the request is successful, a REMOVED event will be raised for each watchlist removed (see
module:caplin/watchlist/WatchlistServiceEvents
). If all the watchlists have not been removed by streamlink after the timeout has elapsed, error will be called.Parameters:
Name Type Attributes Description watchlists
Array.<module:caplin/watchlist/Watchlist> The watchlists to dispose of. error
function <optional>
A callback that will be invoked if the request fails. success
function <optional>
A callback that will be invoked when the request succeeds. - Implements:
- See:
Throws:
-
If the given watchlists are not Watchlists, not found in the current list, or if error and success are not functions.
-
getById()
-
- Implements:
-
getWatchlistCount()
-
getWatchlists()
-
setRequestTimeout(duration)
-
Set the duration in milliseconds for how long to wait after a contrib before timing out and calling the error callback. If this method is never called, the timeout defaults to
module:caplin/sljsadapter/watchlist/StreamLinkWatchlistServiceConstants#CONTRIB_TIMEOUT
Parameters:
Name Type Description duration
Number duration in milliseconds for timeouts for contribs to back-end
Type Definitions
-
createSuccessCallback(watchlist)
-
A callback function called upon success of
module:caplin/sljsadapter/providers/StreamLinkWatchlistService#create
.Parameters:
Name Type Description watchlist
module:caplin/sljsadapter/watchlist/StreamLinkWatchlist The newly created watchlist object.