Twitch SDK (Internal)
Public Member Functions | List of all members
ttv::broadcast::IBroadcastAPIListener Class Referenceabstract

#include <broadcastlistener.h>

Inheritance diagram for ttv::broadcast::IBroadcastAPIListener:
ttv::IModuleListener ttv::binding::java::NativeListenerProxy< IBroadcastAPIListener > ttv::binding::java::NativeModuleListener< IBroadcastAPIListener > ttv::binding::java::JavaBroadcastAPIListenerProxy

Public Member Functions

virtual void BroadcastStateChanged (TTV_ErrorCode ec, BroadcastState state)=0
 
virtual void BroadcastBandwidthWarning (TTV_ErrorCode ec, uint32_t backupMilliseconds)=0
 
virtual void BroadcastFrameSubmissionIssue (TTV_ErrorCode ec)=0
 
virtual void StreamInfoFetched (TTV_ErrorCode ec, const StreamInfo &streamInfo)=0
 
virtual void ModuleStateChanged (IModule *source, IModule::State state, TTV_ErrorCode ec)=0
 

Detailed Description

Listener interface for callbacks from BroadcastAPI.

Member Function Documentation

◆ BroadcastBandwidthWarning()

virtual void ttv::broadcast::IBroadcastAPIListener::BroadcastBandwidthWarning ( TTV_ErrorCode  ec,
uint32_t  backupMilliseconds 
)
pure virtual

Fired periodically when there are issues with the user's bandwidth while broadcasting. If the connection backs up too much then a proper error wil be issues and the broadcast will automatically terminate. If/when issues have recovered then TTV_EC_SUCCESS will be fired once to clear the warning state.

Parameters
ecThe severity of the warning. Possible values are TTV_WRN_BROADCAST_FRAMES_QUEUEING, TTV_EC_BROADCAST_FRAME_QUEUE_TOO_LONG and TTV_EC_SUCCESS.
backupMillisecondsThe number of milliseconds which are backed up on the connection.

Implemented in ttv::binding::java::JavaBroadcastAPIListenerProxy.

◆ BroadcastFrameSubmissionIssue()

virtual void ttv::broadcast::IBroadcastAPIListener::BroadcastFrameSubmissionIssue ( TTV_ErrorCode  ec)
pure virtual

◆ BroadcastStateChanged()

virtual void ttv::broadcast::IBroadcastAPIListener::BroadcastStateChanged ( TTV_ErrorCode  ec,
BroadcastState  state 
)
pure virtual

Fired when the state of the broadcast changes for any reason. If the BroadcastState is Stopping, we will return TTV_EC_SUCCESS if it was a solicited stop (from a call to StopBroadcast). Otherwise it will reflect the underlying error that caused the broadcast to end. Some examples include: TTV_EC_SOCKET_ENOTCONN, TTV_EC_SOCKET_ECONNABORTED, TTV_EC_SOCKET_SEND_ERROR, TTV_EC_SOCKET_RECV_ERROR Socket failures when communicating with the server. TTV_EC_BROADCAST_RTMP_TIMEOUT Server stopped responding to our RTMP data. This can happen if there is another broadcasting session running. TTV_EC_HTTPREQUEST_ERROR HTTP failure when attempting to fetch some of the channel data for the stream.

Implemented in ttv::binding::java::JavaBroadcastAPIListenerProxy.

◆ ModuleStateChanged()

virtual void ttv::IModuleListener::ModuleStateChanged ( IModule source,
IModule::State  state,
TTV_ErrorCode  ec 
)
pure virtualinherited

◆ StreamInfoFetched()

virtual void ttv::broadcast::IBroadcastAPIListener::StreamInfoFetched ( TTV_ErrorCode  ec,
const StreamInfo streamInfo 
)
pure virtual

Fired when we get the broadcast_id from the livecheck API. The broadcast_id (also known as stream_id) is the id of the stream that the user is current broadcasting. This should fire 5-20s after the broadcast starts once we get the broadcast_id from the livecheck API, but could take a while due to latency (10s~) on the endpoint.

The callback may not be called if the broadcast stops before we have a chance to fetch it.

Implemented in ttv::binding::java::JavaBroadcastAPIListenerProxy.


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