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

The Viewer class. Its purpose is to receive media by subscribing to a millicast stream. The stream must already exists and someone must publish media. More...

#include <viewer.h>

Inheritance diagram for millicast::promises::Viewer:
Inheritance graph
[legend]
Collaboration diagram for millicast::promises::Viewer:
Collaboration graph
[legend]

Public Member Functions

virtual Promise< void > subscribe (std::optional< ViewerOption > &&options=std::nullopt)=0
 Subscribe to a Millicast stream. You must be connected first in order to subscribe to a stream.
 
virtual Promise< void > unsubscribe ()=0
 Stop receiving media from Millicast.
 
virtual Promise< bool > is_subscribed () const =0
 Tell if the viewer is subscribed.
 
virtual Promise< void > project (std::string &&source_id, std::vector< ViewerProjectionData > &&pdata)=0
 
virtual Promise< void > unproject (std::vector< std::string > &&mids)=0
 
virtual Promise< void > select (std::optional< ViewerLayerData > &&layer)=0
 
virtual Promise< void > add_remote_track (std::string &&kind)=0
 
virtual Promise< void > set_credentials (ViewerCredentials &&creds)=0
 Set the viewer credentials.
 
virtual Promise< ViewerCredentialsget_credentials () const =0
 Get the current viewer credentials.
 
virtual Promise< void > set_listener (ViewerListener *listener)=0
 set_listener : set the viewer listener to receive event from the viewer.
 
virtual compat::Viewerget_old_api ()=0
 Gets the synchronous API for this viewer. Note that it will be deprecated in the future.
 
- Public Member Functions inherited from millicast::promises::Client
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.
 
virtual Promise< std::optional< std::string > > get_mid (std::string &&track_id)=0
 
virtual Promise< 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< Viewercreate ()
 Create a new viewer.
 
- 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.
 

Additional Inherited Members

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

Detailed Description

The Viewer class. Its purpose is to receive media by subscribing to a millicast stream. The stream must already exists and someone must publish media.

Member Function Documentation

◆ add_remote_track()

virtual Promise< void > millicast::promises::Viewer::add_remote_track ( std::string &&  kind)
pure virtual

◆ create()

static std::unique_ptr< Viewer > millicast::promises::Viewer::create ( )
static

Create a new viewer.

Returns
A new Viewer object.

◆ get_credentials()

virtual Promise< ViewerCredentials > millicast::promises::Viewer::get_credentials ( ) const
pure virtual

Get the current viewer credentials.

Returns
Promise object providing asynchronous status.

◆ get_old_api()

virtual compat::Viewer & millicast::promises::Viewer::get_old_api ( )
pure virtual

Gets the synchronous API for this viewer. Note that it will be deprecated in the future.

Returns
old API

◆ is_subscribed()

virtual Promise< bool > millicast::promises::Viewer::is_subscribed ( ) const
pure virtual

Tell if the viewer is subscribed.

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

◆ project()

virtual Promise< void > millicast::promises::Viewer::project ( std::string &&  source_id,
std::vector< ViewerProjectionData > &&  pdata 
)
pure virtual

◆ select()

virtual Promise< void > millicast::promises::Viewer::select ( std::optional< ViewerLayerData > &&  layer)
pure virtual

◆ set_credentials()

virtual Promise< void > millicast::promises::Viewer::set_credentials ( ViewerCredentials &&  creds)
pure virtual

Set the viewer credentials.

Parameters
credsThe credentials
Returns
Promise object providing asynchronous status.

◆ set_listener()

virtual Promise< void > millicast::promises::Viewer::set_listener ( ViewerListener listener)
pure virtual

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

Parameters
listenerThe Viewer listener

◆ subscribe()

virtual Promise< void > millicast::promises::Viewer::subscribe ( std::optional< ViewerOption > &&  options = std::nullopt)
pure virtual

Subscribe to a Millicast stream. You must be connected first in order to subscribe to a stream.

Parameters
optionssubscribing options (optional)
Returns
Promise object providing asynchronous status.
Remarks
when the success callback on the returned promise is invoked, the Viewer is subscribed. There's no need to implement listener's on_subscribed method.

◆ unproject()

virtual Promise< void > millicast::promises::Viewer::unproject ( std::vector< std::string > &&  mids)
pure virtual

◆ unsubscribe()

virtual Promise< void > millicast::promises::Viewer::unsubscribe ( )
pure virtual

Stop receiving media from Millicast.

Returns
Promise object providing asynchronous status.

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