1#ifndef MILLICAST_API_PUBLISHER_H
2#define MILLICAST_API_PUBLISHER_H
85 std::optional<std::string>
87 std::optional<std::string>
133 std::optional<PublisherOption>&& options = std::nullopt) = 0;
191 static std::unique_ptr<Publisher>
create();
The Client base class.
Definition client.h:142
The Publisher class. Its purpose is to publish media to a Millicast stream.
Definition publisher.h:110
virtual Promise< void > record()=0
Starts recording of the published stream.
virtual Promise< void > add_track(std::weak_ptr< Track > track)=0
virtual EventConnectionPtr add_event_handler(EventHandler< PeerConnectionState > &&handler)=0
Attach the event handler for the PeerConnectionState change event.
virtual Promise< void > unrecord()=0
Stops recording of the published stream.
virtual Promise< PublisherCredentials > get_credentials() const =0
Get the current publisher credentials.
static std::unique_ptr< Publisher > create()
Create a publisher object.
virtual Promise< void > add_track(std::weak_ptr< VideoTrack > track)=0
virtual EventConnectionPtr add_event_handler(EventHandler< FirstViewerActive > &&handler)=0
Attach the event handler for when first viewer is active in stream.
virtual EventConnectionPtr add_event_handler(EventHandler< StatsEvent > &&handler)=0
Attach the event handler for the StatsEvent containing the StatsReport..
virtual EventConnectionPtr add_event_handler(EventHandler< WebsocketState > &&handler)=0
Attach the event handler for the WebsocketState change event.
virtual Promise< bool > is_publishing() const =0
Tell if the publisher is publishing.
virtual Promise< void > publish(std::optional< PublisherOption > &&options=std::nullopt)=0
Publish a stream to Millicast You must be connected first in order to publish a stream.
virtual Promise< void > unpublish()=0
Stop sending media to Millicast. The SDK will automatically disconnect after unpublish.
virtual Promise< void > set_frame_metadata_handler(EncodedVideoFrameCallback &&callback)=0
Set a callback to receive encoded video frames that you can embed metadata into.
virtual EventConnectionPtr add_event_handler(EventHandler< LastViewerInactive > &&handler)=0
Attach the event handler for when last viewer has left stream.
virtual EventConnectionPtr add_event_handler(EventHandler< SignalingError > &&handler)=0
Attach the event handler for the SignalingError event.
virtual Promise< void > add_track(std::weak_ptr< AudioTrack > track)=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< void > set_credentials(PublisherCredentials &&creds)=0
Set the publisher credentials.
virtual Promise< void > clear_tracks()=0
virtual EventConnectionPtr add_event_handler(EventHandler< HttpConnectionError > &&handler)=0
Attach the event handler for the HttpConnectionError event.
#define MILLICAST_API
Definition exports.h:51
Definition capabilities.h:15
ScalabilityMode
Definition publisher.h:23
std::function< void(const EventTypes &...)> EventHandler
Definition event_handling.h:10
std::unique_ptr< EventConnection > EventConnectionPtr
Definition event_handling.h:31
std::function< void(EncodedVideoFrame &)> EncodedVideoFrameCallback
Definition encoded_frames.h:116
Allows setting the desired minimum and/or maximum bitrates when publishing a stream....
Definition client.h:53
The ClientOption struct allows to setup the millicast connection.
Definition client.h:84
Definition publisher.h:115
std::string description
Definition publisher.h:116
Definition publisher.h:119
std::string description
Definition publisher.h:120
The Credentials struct represent the credentials need to be able to connect and publish to a Millicas...
Definition publisher.h:62
std::string api_url
Definition publisher.h:70
bool is_valid
Definition publisher.h:63
std::string token
Definition publisher.h:68
std::string stream_name
Definition publisher.h:66
Option specific to the publisher.
Definition publisher.h:77
std::optional< ScalabilityMode > svc_mode
Definition publisher.h:96
std::optional< std::string > video
Definition publisher.h:86
bool record_stream
Definition publisher.h:101
BitrateSettings bitrate_settings
Definition publisher.h:99
std::optional< int > priority
Definition publisher.h:103
std::optional< std::string > audio
Definition publisher.h:88
struct millicast::PublisherOption::@0 multisource
std::optional< std::string > source_id
Definition publisher.h:80
bool simulcast
Enable simulcast (for VP8 and H264 only)
Definition publisher.h:94
struct millicast::PublisherOption::@1 codecs