1#ifndef MILLICAST_API_VIEWER_H
2#define MILLICAST_API_VIEWER_H
30 std::optional<std::string>
33 std::optional<uint8_t>
37 std::vector<std::string>
158 std::optional<ViewerOption>&& options = std::nullopt) = 0;
309 std::string_view cname) = 0;
The Client base class.
Definition client.h:142
The Viewer class. Its purpose is to receive media by subscribing to a millicast stream....
Definition viewer.h:135
virtual Promise< std::vector< WebrtcRemoteAudioTrack * > > webrtc_audio_tracks() const =0
virtual EventConnectionPtr add_event_handler(EventHandler< RtsTrackAdded > &&handler)=0
Attach the event handler for discovery of new RTS tracks.
virtual Promise< WebrtcRemoteTrack * > add_webrtc_remote_track(WebrtcRemoteTrack::Kind kind, std::string_view cname)=0
virtual EventConnectionPtr add_event_handler(EventHandler< WebsocketState > &&handler)=0
Attach the event handler for the WebsocketState change event.
virtual void enable_seamless_migration(bool enabled=true)=0
virtual EventConnectionPtr add_event_handler(EventHandler< PeerConnectionState > &&handler)=0
Attach the event handler for the PeerConnectionState change event.
virtual Promise< bool > is_subscribed() const =0
Tell if the viewer is subscribed.
virtual Promise< std::vector< WebrtcRemoteVideoTrack * > > webrtc_video_tracks() const =0
virtual EventConnectionPtr add_event_handler(EventHandler< ViewerCount > &&handler)=0
Attach the event handler for the ViewerCount event emitted when the viewer count has changed.
virtual Promise< ViewerCredentials > get_credentials() const =0
Get the current viewer credentials.
virtual Promise< std::vector< RtsRemoteVideoTrack * > > video_tracks() const =0
virtual Promise< std::vector< RtsRemoteAudioTrack * > > audio_tracks() const =0
virtual Promise< void > unsubscribe()=0
Stop receiving media from Millicast.
virtual EventConnectionPtr add_event_handler(EventHandler< StreamStopped > &&handler)=0
Attach the event handler for the StreamStopped event.
virtual EventConnectionPtr add_event_handler(EventHandler< HttpConnectionError > &&handler)=0
Attach the event handler for the HttpConnectionError event.
static std::unique_ptr< Viewer > create()
Create a new viewer.
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 > set_credentials(ViewerCredentials &&creds)=0
Set the viewer credentials.
virtual EventConnectionPtr add_event_handler(EventHandler< SignalingError > &&handler)=0
Attach the event handler for the SignalingError event.
virtual EventConnectionPtr add_event_handler(EventHandler< StatsEvent > &&handler)=0
Attach the event handler for the StatsEvent containing the StatsReport..
Kind
Definition track.h:183
#define MILLICAST_API
Definition exports.h:51
Definition capabilities.h:15
std::function< void(const EventTypes &...)> EventHandler
Definition event_handling.h:10
std::unique_ptr< EventConnection > EventConnectionPtr
Definition event_handling.h:31
The ClientOption struct allows to setup the millicast connection.
Definition client.h:84
RtsRemoteTrack & track
Definition viewer.h:196
The Stream Stopped event is emitted when the viewer has requested to disconnect from the media server...
Definition viewer.h:144
std::string description
Definition viewer.h:145
The ViewerCredentials struct represent the credentials need to be able to connect and subscribe to a ...
Definition viewer.h:118
bool is_valid
Definition viewer.h:119
std::string stream_name
Definition viewer.h:122
std::string api_url
Definition viewer.h:127
std::string account_id
Definition viewer.h:125
std::optional< std::string > token
Definition viewer.h:124
Structure describing playout delay to be enforced on the client. https://webrtc.googlesource....
Definition viewer.h:48
int min
Definition viewer.h:49
int max
Definition viewer.h:50
bool force_smooth
Definition viewer.h:85
std::optional< unsigned int > upwards_layer_wait_time_ms
Duration the Transponder will wait before switching back to a higher layer in msec....
Definition viewer.h:100
std::optional< uint8_t > multiplexed_audio_track
Definition viewer.h:34
int jitter_minimum_delay_ms
Definition viewer.h:68
std::vector< std::string > excluded_source_id
Definition viewer.h:38
std::optional< unsigned int > bwe_monitor_duration_us
overrides the duration of time over which bandwidth-estimate-calculations occur in usec By default th...
Definition viewer.h:94
struct millicast::ViewerOption::@2 multisource
The structure describing viewership of multisource events. This is valid for events where multiple pu...
std::optional< unsigned int > maximum_bitrate
Set the maximum bitrate in KBps that can be used by the viewer.
Definition viewer.h:61
std::optional< std::string > pinned_source_id
Definition viewer.h:31
std::optional< double > bwe_rate_change_percentage
Definition viewer.h:110
std::optional< ForcePlayoutDelay > force_playout_delay
The playout delay to enforce on the client side.
Definition viewer.h:56
bool disable_audio
Definition viewer.h:63