MillicastSDK 1.8.4
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | List of all members
millicast::compat::Publisher Class Referenceabstract

The Publisher class. Its purpose is to publish media to a Millicast stream. More...

#include <publisher.h>

Inheritance diagram for millicast::compat::Publisher:
Inheritance graph
[legend]
Collaboration diagram for millicast::compat::Publisher:
Collaboration graph
[legend]

Public Types

using Credentials = PublisherCredentials
 
using Listener = PublisherListener
 
using Option = PublisherOption
 
- Public Types inherited from millicast::ClientBase
using Listener = ClientListener
 
using ConnectionOptions = ClientConnectionOptions
 
using Option = ClientOption
 
using JsonData = ClientJsonData
 

Public Member Functions

virtual bool publish (const std::optional< Publisher::Option > &options=std::nullopt)=0
 Publish a stream to Millicast You must be connected first in order to publish a stream.
 
virtual bool unpublish ()=0
 Stop sending media to Millicast. The SDK will automatically disconnect after unpublish.
 
virtual bool is_publishing () const =0
 Tell if the publisher is publishing.
 
virtual void record ()=0
 
virtual void unrecord ()=0
 
virtual bool set_credentials (const Credentials &creds)=0
 Set the publisher credentials.
 
virtual bool set_credentials (Credentials &&creds)=0
 
virtual Credentials get_credentials () const =0
 Get the current publisher credentials.
 
virtual void add_track (std::weak_ptr< Track > track)=0
 Add a track that will be used to publish media (audio or video).
 
virtual void add_track (std::weak_ptr< VideoTrack > track)=0
 
virtual void add_track (std::weak_ptr< AudioTrack > track)=0
 
virtual void clear_tracks ()=0
 clear_tracks will clear all track added to the publisher.
 
virtual void set_listener (Publisher::Listener *listener)=0
 set_listener : set the viewer listener to receive event from the viewer.
 
virtual void set_recording_listener (RecordingListener *rlistener)=0
 
- Public Member Functions inherited from millicast::compat::Client
virtual bool connect (const std::optional< ConnectionOptions > &connection_options=std::nullopt)=0
 Connect and open a websocket connection with the Millicast platform.
 
virtual bool connect (const JsonData &data, const std::optional< ConnectionOptions > &connection_options=std::nullopt)=0
 Connect to the media server directly using the websocket url and the JWT.
 
virtual bool is_connected () const =0
 is_connected
 
virtual bool 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 void enable_stats (bool enable)=0
 Enable the rtc stats collecting. The stats are collected once the client is either publishing or subscribed.
 
virtual std::optional< std::string > get_mid (const std::string &track_id)=0
 Get the transceiver mid associated to a track if any.
 
virtual void enable_frame_transformer (bool enable)=0
 Add frame transformer so you can add metadata to frame When a new transformable frame is available, the listener method on_transformable_frame will be called.
 
- Public Member Functions inherited from millicast::ClientBase
virtual ~ClientBase ()=default
 

Static Public Member Functions

static std::unique_ptr< Publishercreate ()
 Create a publisher object.
 
- 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 Publisher class. Its purpose is to publish media to a Millicast stream.

Member Typedef Documentation

◆ Credentials

◆ Listener

◆ Option

Member Function Documentation

◆ add_track() [1/3]

virtual void millicast::compat::Publisher::add_track ( std::weak_ptr< AudioTrack track)
pure virtual

◆ add_track() [2/3]

virtual void millicast::compat::Publisher::add_track ( std::weak_ptr< Track track)
pure virtual

Add a track that will be used to publish media (audio or video).

Parameters
trackThe track as a weak ptr.

◆ add_track() [3/3]

virtual void millicast::compat::Publisher::add_track ( std::weak_ptr< VideoTrack track)
pure virtual

◆ clear_tracks()

virtual void millicast::compat::Publisher::clear_tracks ( )
pure virtual

clear_tracks will clear all track added to the publisher.

◆ create()

static std::unique_ptr< Publisher > millicast::compat::Publisher::create ( )
static

Create a publisher object.

Returns
A publisher object.

◆ get_credentials()

virtual Credentials millicast::compat::Publisher::get_credentials ( ) const
pure virtual

Get the current publisher credentials.

Returns
The current credentials set in the publisher.

◆ is_publishing()

virtual bool millicast::compat::Publisher::is_publishing ( ) const
pure virtual

Tell if the publisher is publishing.

Returns
true if the publisher is publishing, false otherwise.

◆ publish()

virtual bool millicast::compat::Publisher::publish ( const std::optional< Publisher::Option > &  options = std::nullopt)
pure virtual

Publish a stream to Millicast You must be connected first in order to publish a stream.

Parameters
optionspublishing options (optional)
Returns
true if the publish options are valid, false otherwise.
Remarks
After trying,a successful publish results in the Listener's method on_publishing being called.

◆ record()

virtual void millicast::compat::Publisher::record ( )
pure virtual

◆ set_credentials() [1/2]

virtual bool millicast::compat::Publisher::set_credentials ( const Credentials creds)
pure virtual

Set the publisher credentials.

Parameters
credsThe credentials
Returns
true if the credentials are valid and set correctly, false otherwise.

◆ set_credentials() [2/2]

virtual bool millicast::compat::Publisher::set_credentials ( Credentials &&  creds)
pure virtual

◆ set_listener()

virtual void millicast::compat::Publisher::set_listener ( Publisher::Listener listener)
pure virtual

set_listener : set the viewer listener to receive event from the viewer.

Parameters
listenerThe Publisher listener

◆ set_recording_listener()

virtual void millicast::compat::Publisher::set_recording_listener ( RecordingListener rlistener)
pure virtual

◆ unpublish()

virtual bool millicast::compat::Publisher::unpublish ( )
pure virtual

Stop sending media to Millicast. The SDK will automatically disconnect after unpublish.

Returns
false if unable to reach a disconnected state, true otherwise.

◆ unrecord()

virtual void millicast::compat::Publisher::unrecord ( )
pure virtual

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