MillicastSDK 1.8.4
Loading...
Searching...
No Matches
Public Member Functions | List of all members
millicast::ClientListener Struct Referenceabstract

The Client Listener struct which contains methods that will be called on specific events from a Client object. More...

#include <client.h>

Inheritance diagram for millicast::ClientListener:
Inheritance graph
[legend]

Public Member Functions

virtual void on_connected ()=0
 on_connected is called when the WebSocket connection to Millicast is opened
 
virtual void on_disconnected ()=0
 on_disconnected is called when the WebSocket connection to Millicast is closed. If this was an unintended disconnect, a reconnect attempt will happen automatically by default. To turn off the automatic reconnect, set {Option::auto_reconnect} to false.
 
virtual void on_connection_error (int status, const std::string &reason)=0
 on_connection_error is called when the attempt to connect to Millicast failed.
 
virtual void on_signaling_error (const std::string &message)=0
 Called when millicast sends back an error message in response to a websocket command.
 
virtual void on_stats_report (std::unique_ptr< StatsReport >)
 on_stats_report is called when a new rtc stats report has been collected.
 
virtual void on_viewer_count (int count)=0
 Called when a new viewer join the stream or when a viewer quit the stream.
 
virtual ~ClientListener ()=default
 

Detailed Description

The Client Listener struct which contains methods that will be called on specific events from a Client object.

Constructor & Destructor Documentation

◆ ~ClientListener()

virtual millicast::ClientListener::~ClientListener ( )
virtualdefault

Member Function Documentation

◆ on_connected()

virtual void millicast::ClientListener::on_connected ( )
pure virtual

on_connected is called when the WebSocket connection to Millicast is opened

◆ on_connection_error()

virtual void millicast::ClientListener::on_connection_error ( int  status,
const std::string &  reason 
)
pure virtual

on_connection_error is called when the attempt to connect to Millicast failed.

Parameters
statusThe HTTP status code.
reasonThe reason the connection attempt failed.

◆ on_disconnected()

virtual void millicast::ClientListener::on_disconnected ( )
pure virtual

on_disconnected is called when the WebSocket connection to Millicast is closed. If this was an unintended disconnect, a reconnect attempt will happen automatically by default. To turn off the automatic reconnect, set {Option::auto_reconnect} to false.

◆ on_signaling_error()

virtual void millicast::ClientListener::on_signaling_error ( const std::string &  message)
pure virtual

Called when millicast sends back an error message in response to a websocket command.

Parameters
messageThe error message received from millicast

◆ on_stats_report()

virtual void millicast::ClientListener::on_stats_report ( std::unique_ptr< StatsReport )
inlinevirtual

on_stats_report is called when a new rtc stats report has been collected.

Remarks
You must enable the stats to be able to receive a report.
See also
enable_stats

◆ on_viewer_count()

virtual void millicast::ClientListener::on_viewer_count ( int  count)
pure virtual

Called when a new viewer join the stream or when a viewer quit the stream.

Parameters
countThe current number of viewers.

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