-
Notifications
You must be signed in to change notification settings - Fork 3
Channel Class
CreativeBuilds edited this page May 5, 2019
·
3 revisions
Can be found from listening to messages.
const Channel = require("dlive-js/src/classes/Channel");
new Channel({dliveUsername, blockchainUsername, User}, permissionObj) // Returns a dlive-js Channel Object| name | returns | description |
|---|---|---|
| dliveUsername | string | the displayname of the streamer |
| blockchainUsername | string | an id of the streamer that cant be changed, and is their "lino username" |
| user | User | returns a dlive-js User object of the user who sent the message |
| livestream | null or DLiveLivestreamObject | null if stream is offline or LivestreamObject if online |
| rxLivestream | RXJS BehaviorSubject | Subscribe to this in order to receive updates on when livestream goes live, or offline (updates in viewers etc) Updates every 30 seconds |
| updateInterval | Interval | An Interval that runs every 30 seconds to update rxLivestream |
| name | returns | description |
|---|---|---|
| getPermissionObj | Function() -> PermissionObj | returns the permission object that was passed into it on creation |
| updateLivestream | Function() -> Promise(DLiveLivestreamObject) | returns a promise of the livestream object (and also pushes this object to the rxLivstream Behavior Subject (Runs every 30 seconds from updateInterval |
| getIsLive | Function() -> Promise(Boolean) | returns promise of a boolean value if the stream is live or not |
| getViewers | Function() -> Promise(Integer) | returns promise of how many viewers are in stream |