Constructor
# new streamActions()
We use this modules for calls to our backend API for actiosn relating to streams
Methods
# static acceptRequestToJoin(data)
Accepts a request to join stream from a user
Parameters:
Name | Type | Description |
---|---|---|
data |
* | data of the request we want to reject |
# static closeStream()
Closes the current user's stream
# static createNewStream(streamData)
Tries to create a new stream using the streamData and redirects to newly created page upon success
Note: This will fail if now user is signed in/ or the user already has a current stream
Parameters:
Name | Type | Description |
---|---|---|
streamData |
* | the data of the stream we wish to create |
# static getAllStreamGroupsStreams(streamGroups)
Returns all the data regarding twitch streams of users in the streamGroups
Parameters:
Name | Type | Description |
---|---|---|
streamGroups |
* | streamGroups to check data for |
# static getStreamById(streamId)
Returns the data of the stream with given id
Parameters:
Name | Type | Description |
---|---|---|
streamId |
* | id of the stream |
# static getStreamsByStatus(page, status)
Finds all streams with a given status
Parameters:
Name | Type | Description |
---|---|---|
page |
* | what page to request |
status |
* | stream status |
# static getYoutubeVideoId(channelId)
Returns the live video id of the requested channel id,
Parameters:
Name | Type | Description |
---|---|---|
channelId |
* | the id of the channel we are trying to get live video from |
# static rejectRequestToJoin(data)
Rejects a request to join stream from a user
Parameters:
Name | Type | Description |
---|---|---|
data |
* | data of the request we want to reject |
# static requestToJoinStream(data, creatorId)
Sends a request from currently logged in user to join a stream
Note: Requests are cached and are limited to one request per user every 2 minutes
Parameters:
Name | Type | Description |
---|---|---|
data |
* | formatted data of the current user (which is verified in the backend) |
creatorId |
* | Id of the creator to send request to |
string describing error if failed, otherwise a request is sent
# static searchStreams(searchString, page, status)
Searches all streams split to pages by a search string
Searches tags/description/name
Parameters:
Name | Type | Description |
---|---|---|
searchString |
* | string to search |
page |
* | what page to request |
status |
* | stream status |