MillicastSDK 1.8.4
|
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>
Public Types | |
using | Option = ViewerOption |
using | Credentials = ViewerCredentials |
using | LayerData = ViewerLayerData |
using | ProjectionData = ViewerProjectionData |
using | Listener = ViewerListener |
Public Types inherited from millicast::ClientBase | |
using | Listener = ClientListener |
using | ConnectionOptions = ClientConnectionOptions |
using | Option = ClientOption |
using | JsonData = ClientJsonData |
Public Member Functions | |
virtual bool | subscribe (const std::optional< Viewer::Option > &options=std::nullopt)=0 |
Subscribe to a Millicast stream. You must be connected first in order to subscribe to a stream. | |
virtual bool | unsubscribe ()=0 |
Stop receiving media from Millicast. The SDK will automatically disconnect after unsubscribe. | |
virtual bool | is_subscribed () const =0 |
Tell whether the viewer is subscribed or not. | |
virtual bool | project (const std::string &source_id, const std::vector< ProjectionData > &pdata)=0 |
Send a command to the media server to forward a media into a specific transceiver. | |
virtual bool | unproject (const std::vector< std::string > &mids)=0 |
Send a command to stop the projection of a source. | |
virtual bool | select (std::optional< LayerData > layer)=0 |
Send a command to select a simulcast layer (if simulcast is enabled). | |
virtual bool | add_remote_track (std::string_view kind)=0 |
Dynamically add another track to the peerconnection adn renegociate SDP locally When the track is created, the listener's method on track will be called. | |
virtual bool | set_credentials (const Credentials &creds)=0 |
Set the viewer credentials. | |
virtual bool | set_credentials (Credentials &&creds)=0 |
virtual Credentials | get_credentials () const =0 |
Get the current viewer credentials. | |
virtual void | set_listener (Viewer::Listener *listener)=0 |
set_listener : set the viewer listener to receive event from the viewer. | |
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< Viewer > | create () |
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. | |
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.
|
pure virtual |
Dynamically add another track to the peerconnection adn renegociate SDP locally When the track is created, the listener's method on track will be called.
kind | Whether it is a video or audio track. Accepted value are "video" or "audio". |
|
static |
Create a new viewer.
|
pure virtual |
Get the current viewer credentials.
|
pure virtual |
Tell whether the viewer is subscribed or not.
|
pure virtual |
Send a command to the media server to forward a media into a specific transceiver.
source_id | The id of the source publishing media (see multisource). |
pdata | The projection data to send to the server. |
|
pure virtual |
Send a command to select a simulcast layer (if simulcast is enabled).
layer | The layer to select. Leave the optional empty if you want to let the server choose automatically the layer. |
|
pure virtual |
Set the viewer credentials.
creds | The credentials |
|
pure virtual |
|
pure virtual |
set_listener : set the viewer listener to receive event from the viewer.
listener | The Viewer listener |
|
pure virtual |
Subscribe to a Millicast stream. You must be connected first in order to subscribe to a stream.
options | subscribing options (optional) |
|
pure virtual |
Send a command to stop the projection of a source.
mids | The transceivers mids to stop projecting. |
|
pure virtual |
Stop receiving media from Millicast. The SDK will automatically disconnect after unsubscribe.