Skip to main content

Livestream Objects and Methods

DyteLivestream object obtained by dyteMobileClient.livestream method. The objects and methods it contains are defined below.

Objects

Data

DyteLivestreamData object accessed via dyteMobileClient.livestream.data contains the data related to metadata for livestream. It has 4 properties:

  1. roomName: The name of the room.
  2. state: The current status of the livestream, possible values can be:
    • DyteLivestreamStatus.none
    • DyteLivestreamStatus.starting
    • DyteLivestreamStatus.started
    • DyteLivestreamStatus.ending
    • DyteLivestreamStatus.ended
    • DyteLivestreamStatus.errored
  3. url: The url of the livestream.
  4. viewerCount: The number of viewers in the livestream.

Requests

requests: List<DyteLiveStreamStageRequestPeer> object accessed via dyteMobileClient.livestream.requests contains the list of requests to join the stage. Each request contains 3 properties:

  1. peerId: The peer ID of the user who requested to join the stage.
  2. userId: The user ID of the user who requested to join the stage.
  3. displayName: The display name of the user who requested to join the stage.

Methods

getUrl()

[Future<String?>]: Returns the url of the livestream.

getRoomName()

[Future<String?>]: Returns the name of the room.

getState()

[Future<String?>]: Returns the current status of the livestream.

Host control methods

Dyte’s stage management APIs allow hosts to receive and manage stage requests as well as leave and join the stage.

Accept request

This method lets the host accept a request to join the stage. It takes the DyteLiveStreamStageRequestPeer as an argument whose request has to be accepted.

dyteMobileClient.livestream.acceptRequest(peer);

Reject request

This method lets the host reject a request to join the stage. It takes the DyteLiveStreamStageRequestPeer as an argument whose request has to be rejected.

dyteMobileClient.livestream.rejectRequest(peer);

Accept all requests

This method lets the host accept all the requests to join the stage.

dyteMobileClient.livestream.acceptAll();

Reject all requests

This method lets the host reject all the requests to join the stage.

dyteMobileClient.livestream.rejectAll();