MillicastSDK 2.0.0
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | List of all members
millicast::Client Class Referenceabstract

The Client base class. More...

#include <client.h>

Inheritance diagram for millicast::Client:
Inheritance graph
[legend]
Collaboration diagram for millicast::Client:
Collaboration graph
[legend]

Classes

struct  HttpConnectionError
 The Http Connection Error event is emitted when there is a problem connecting to the millicast backend. More...
 
struct  PeerConnectionState
 This event describes the current state of the Peer Connection. More...
 
struct  SignalingError
 The Signaling Error event is emitted when a message attempted to be sent on the signaling channel is rejected. More...
 
struct  StatsEvent
 The Stats Event that is emitted by the SDK containing the stats report. The stats provide insight into the incoming/audio media and rtp data. More...
 
struct  ViewerCount
 The Viewer Count event emitted by the SDK when the number of viewers for a stream changes. More...
 
struct  WebsocketState
 This event describes the current state of the websocket. More...
 

Public Types

enum class  ConnectionState {
  IDLE , CONNECTING , CONNECTED , RECONNECTING ,
  DISCONNECTING , FAILED
}
 The Connection State enum describes the possible states that a network connecting socket can be in. This enum will be used in the WebsocketState and PeerConnectionState events to describe the state of those network mediums. More...
 
- Public Types inherited from millicast::ClientBase
using ConnectionOptions = ClientConnectionOptions
 
using Option = ClientOption
 
using JsonData = ClientJsonData
 

Public Member Functions

virtual Promise< void > connect (std::optional< ConnectionOptions > &&connection_options)=0
 Connect and open a websocket connection with the Millicast platform.
 
virtual Promise< void > connect (JsonData &&data, std::optional< ConnectionOptions > &&connection_options)=0
 Connect to the media server directly using the websocket url and the JWT.
 
virtual Promise< bool > is_connected () const =0
 is_connected
 
virtual Promise< void > disconnect ()=0
 Disconnect from Millicast. The websocket connection to Millicast will no longer be active after disconnect is complete. If the client is currently publishing/subscribing, the SDK will first stop the publishing/subscribing before disconnecting.
 
virtual Promise< void > enable_stats (bool enable)=0
 Enable the rtc stats collecting. The stats are collected once the client is either publishing or subscribed.
 
- Public Member Functions inherited from millicast::ClientBase
virtual ~ClientBase ()=default
 

Additional Inherited Members

- Static Public Member Functions inherited from millicast::ClientBase
static std::list< std::string > get_supported_video_codecs ()
 get_supported_video_codecs returns the list of the supported video codecs.
 
static std::list< std::string > get_supported_audio_codecs ()
 get_supported_audio_codecs returns the list of the supported audio codecs.
 
static void cleanup ()
 Clean and free the memory of dynamic objects.
 

Detailed Description

The Client base class.

This is the base class to handle a connection with the Millicast platform.

Member Enumeration Documentation

◆ ConnectionState

The Connection State enum describes the possible states that a network connecting socket can be in. This enum will be used in the WebsocketState and PeerConnectionState events to describe the state of those network mediums.

Enumerator
IDLE 
CONNECTING 

The initial state of the socket. This state will be entered after graceful close.

CONNECTED 

The socket is in the process of connecting.

RECONNECTING 

The socket has now established a connection.

DISCONNECTING 

The socket has entered reconnection state.

FAILED 

The socket is now in disconnecting state. The socket has entered a failed state.

Member Function Documentation

◆ connect() [1/2]

virtual Promise< void > millicast::Client::connect ( JsonData &&  data,
std::optional< ConnectionOptions > &&  connection_options 
)
pure virtual

Connect to the media server directly using the websocket url and the JWT.

Parameters
dataThe JSON data returned by the director api.
Returns
Promise object providing asynchronous status.
Remarks
when the success callback on the returned promise is invoked, the Client is connected. There's no need to implement listener's on_connected method.

◆ connect() [2/2]

virtual Promise< void > millicast::Client::connect ( std::optional< ConnectionOptions > &&  connection_options)
pure virtual

Connect and open a websocket connection with the Millicast platform.

Returns
Promise object providing asynchronous status.
Remarks
You must set valid credentials before using this method.
when the success callback on the returned promise is invoked, the Client is connected. There's no need to implement listener's on_connected method.

◆ disconnect()

virtual Promise< void > millicast::Client::disconnect ( )
pure virtual

Disconnect from Millicast. The websocket connection to Millicast will no longer be active after disconnect is complete. If the client is currently publishing/subscribing, the SDK will first stop the publishing/subscribing before disconnecting.

Returns
Promise object providing asynchronous status.

◆ enable_stats()

virtual Promise< void > millicast::Client::enable_stats ( bool  enable)
pure virtual

Enable the rtc stats collecting. The stats are collected once the client is either publishing or subscribed.

Parameters
enabletrue to enable the stats, false to disable the stats.
Returns
Promise object providing asynchronous status.

◆ is_connected()

virtual Promise< bool > millicast::Client::is_connected ( ) const
pure virtual

is_connected

Returns
Promise object providing asynchronous status. The completion callback will be invoked with true if connected, and with false if not.

The documentation for this class was generated from the following file: