RtcEngineEventHandler.cs 43 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905
  1. using System;
  2. namespace Agora.Rtc
  3. {
  4. public delegate void OnJoinChannelSuccessHandler(RtcConnection connection, int elapsed);
  5. public delegate void OnErrorHandler(int err, string msg);
  6. public delegate void OnLeaveChannelHandler(RtcConnection connection, RtcStats stats);
  7. public delegate void OnRejoinChannelSuccessHandler(RtcConnection connection, int elapsed);
  8. public delegate void OnProxyConnectedHandler(string channel, uint uid, PROXY_TYPE proxyType, string localProxyIp, int elapsed);
  9. public delegate void OnAudioQualityHandler(RtcConnection connection, uint remoteUid, int quality, UInt16 delay, UInt16 lost);
  10. public delegate void OnLastmileProbeResultHandler(LastmileProbeResult result);
  11. public delegate void OnAudioVolumeIndicationHandler(RtcConnection connection, AudioVolumeInfo[] speakers, uint speakerNumber, int totalVolume);
  12. public delegate void OnRtcStatsHandler(RtcConnection connection, RtcStats stats);
  13. public delegate void OnAudioDeviceStateChangedHandler(string deviceId, MEDIA_DEVICE_TYPE deviceType, MEDIA_DEVICE_STATE_TYPE deviceState);
  14. public delegate void OnAudioMixingFinishedHandler();
  15. public delegate void OnAudioEffectFinishedHandler(int soundId);
  16. public delegate void OnVideoDeviceStateChangedHandler(string deviceId, MEDIA_DEVICE_TYPE deviceType, MEDIA_DEVICE_STATE_TYPE deviceState);
  17. public delegate void OnMediaDeviceChangedHandler(MEDIA_DEVICE_TYPE deviceType);
  18. public delegate void OnNetworkQualityHandler(RtcConnection connection, uint remoteUid, int txQuality, int rxQuality);
  19. public delegate void OnIntraRequestReceivedHandler(RtcConnection connection);
  20. public delegate void OnUplinkNetworkInfoUpdatedHandler(UplinkNetworkInfo info);
  21. public delegate void OnDownlinkNetworkInfoUpdatedHandler(DownlinkNetworkInfo info);
  22. public delegate void OnLastmileQualityHandler(int quality);
  23. public delegate void OnFirstLocalVideoFrameHandler(RtcConnection connection, int width, int height, int elapsed);
  24. public delegate void OnFirstLocalVideoFramePublishedHandler(RtcConnection connection, int elapsed);
  25. public delegate void OnVideoSourceFrameSizeChangedHandler(RtcConnection connection, VIDEO_SOURCE_TYPE sourceType, int width, int height);
  26. public delegate void OnFirstRemoteVideoDecodedHandler(RtcConnection connection, uint remoteUid, int width, int height, int elapsed);
  27. public delegate void OnVideoSizeChangedHandler(RtcConnection connection, VIDEO_SOURCE_TYPE sourceType, uint uid, int width, int height, int rotation);
  28. public delegate void OnContentInspectResultHandler(CONTENT_INSPECT_RESULT result);
  29. public delegate void OnSnapshotTakenHandlerEx(RtcConnection connection, uint uid, string filePath, int width, int height, int errCode);
  30. public delegate void OnLocalVideoStateChangedHandler(VIDEO_SOURCE_TYPE source, LOCAL_VIDEO_STREAM_STATE state, LOCAL_VIDEO_STREAM_ERROR errorCode);
  31. public delegate void OnLocalVideoStateChangedHandlerEx(RtcConnection connection, LOCAL_VIDEO_STREAM_STATE state, LOCAL_VIDEO_STREAM_ERROR errorCode);
  32. public delegate void OnRemoteVideoStateChangedHandler(RtcConnection connection, uint remoteUid, REMOTE_VIDEO_STATE state, REMOTE_VIDEO_STATE_REASON reason, int elapsed);
  33. public delegate void OnFirstRemoteVideoFrameHandler(RtcConnection connection, uint remoteUid, int width, int height, int elapsed);
  34. public delegate void OnUserJoinedHandler(RtcConnection connection, uint remoteUid, int elapsed);
  35. public delegate void OnUserOfflineHandler(RtcConnection connection, uint remoteUid, USER_OFFLINE_REASON_TYPE reason);
  36. public delegate void OnUserMuteAudioHandler(RtcConnection connection, uint remoteUid, bool muted);
  37. public delegate void OnUserMuteVideoHandler(RtcConnection connection, uint remoteUid, bool muted);
  38. public delegate void OnUserEnableVideoHandler(RtcConnection connection, uint remoteUid, bool enabled);
  39. public delegate void OnUserEnableLocalVideoHandler(RtcConnection connection, uint remoteUid, bool enabled);
  40. public delegate void OnUserStateChangedHandler(RtcConnection connection, uint remoteUid, uint state);
  41. public delegate void OnApiCallExecutedHandler(int err, string api, string result);
  42. public delegate void OnLocalAudioStatsHandler(RtcConnection connection, LocalAudioStats stats);
  43. public delegate void OnRemoteAudioStatsHandler(RtcConnection connection, RemoteAudioStats stats);
  44. public delegate void OnLocalVideoStatsHandler(RtcConnection connection, LocalVideoStats stats);
  45. public delegate void OnRemoteVideoStatsHandler(RtcConnection connection, RemoteVideoStats stats);
  46. public delegate void OnCameraReadyHandler();
  47. public delegate void OnCameraFocusAreaChangedHandler(int x, int y, int width, int height);
  48. public delegate void OnCameraExposureAreaChangedHandler(int x, int y, int width, int height);
  49. public delegate void OnFacePositionChangedHandler(int imageWidth, int imageHeight, Rectangle vecRectangle, int[] vecDistance, int numFaces);
  50. public delegate void OnVideoStoppedHandler();
  51. public delegate void OnAudioMixingStateChangedHandler(AUDIO_MIXING_STATE_TYPE state, AUDIO_MIXING_REASON_TYPE reason);
  52. public delegate void OnRhythmPlayerStateChangedHandler(RHYTHM_PLAYER_STATE_TYPE state, RHYTHM_PLAYER_ERROR_TYPE errorCode);
  53. public delegate void OnConnectionLostHandler(RtcConnection connection);
  54. public delegate void OnConnectionInterruptedHandler(RtcConnection connection);
  55. public delegate void OnConnectionBannedHandler(RtcConnection connection);
  56. public delegate void OnStreamMessageHandler(RtcConnection connection, uint remoteUid, int streamId, byte[] data, uint length, UInt64 sentTs);
  57. public delegate void OnStreamMessageErrorHandler(RtcConnection connection, uint remoteUid, int streamId, int code, int missed, int cached);
  58. public delegate void OnRequestTokenHandler(RtcConnection connection);
  59. public delegate void OnTokenPrivilegeWillExpireHandler(RtcConnection connection, string token);
  60. public delegate void OnFirstLocalAudioFramePublishedHandler(RtcConnection connection, int elapsed);
  61. public delegate void OnFirstRemoteAudioFrameHandler(RtcConnection connection, uint userId, int elapsed);
  62. public delegate void OnFirstRemoteAudioDecodedHandler(RtcConnection connection, uint uid, int elapsed);
  63. public delegate void OnLocalAudioStateChangedHandler(RtcConnection connection, LOCAL_AUDIO_STREAM_STATE state, LOCAL_AUDIO_STREAM_ERROR error);
  64. public delegate void OnRemoteAudioStateChangedHandler(RtcConnection connection, uint remoteUid, REMOTE_AUDIO_STATE state, REMOTE_AUDIO_STATE_REASON reason, int elapsed);
  65. public delegate void OnActiveSpeakerHandler(RtcConnection connection, uint uid);
  66. public delegate void OnClientRoleChangedHandler(RtcConnection connection, CLIENT_ROLE_TYPE oldRole, CLIENT_ROLE_TYPE newRole);
  67. public delegate void OnClientRoleChangeFailedHandler(RtcConnection connection, CLIENT_ROLE_CHANGE_FAILED_REASON reason, CLIENT_ROLE_TYPE currentRole);
  68. public delegate void OnAudioDeviceVolumeChangedHandler(MEDIA_DEVICE_TYPE deviceType, int volume, bool muted);
  69. public delegate void OnRtmpStreamingStateChangedHandler(string url, RTMP_STREAM_PUBLISH_STATE state, RTMP_STREAM_PUBLISH_ERROR_TYPE errCode);
  70. public delegate void OnRtmpStreamingEventHandler(string url, RTMP_STREAMING_EVENT eventCode);
  71. //public delegate void OnStreamPublishedHandler(string url, int error);
  72. //public delegate void OnStreamUnpublishedHandler(string url);
  73. public delegate void OnTranscodingUpdatedHandler();
  74. public delegate void OnAudioRoutingChangedHandler(int routing);
  75. public delegate void OnChannelMediaRelayStateChangedHandler(int state, int code);
  76. public delegate void OnChannelMediaRelayEventHandler(int code);
  77. public delegate void OnLocalPublishFallbackToAudioOnlyHandler(bool isFallbackOrRecover);
  78. public delegate void OnRemoteSubscribeFallbackToAudioOnlyHandler(uint uid, bool isFallbackOrRecover);
  79. public delegate void OnRemoteAudioTransportStatsHandler(RtcConnection connection, uint remoteUid, UInt16 delay, UInt16 lost, UInt16 rxKBitRate);
  80. public delegate void OnRemoteVideoTransportStatsHandler(RtcConnection connection, uint remoteUid, UInt16 delay, UInt16 lost, UInt16 rxKBitRate);
  81. public delegate void OnConnectionStateChangedHandler(RtcConnection connection, CONNECTION_STATE_TYPE state, CONNECTION_CHANGED_REASON_TYPE reason);
  82. public delegate void OnWlAccMessageHandler(RtcConnection connection, WLACC_MESSAGE_REASON reason, WLACC_SUGGEST_ACTION action, string wlAccMsg);
  83. public delegate void OnWlAccStatsHandler(RtcConnection connection, WlAccStats currentStats, WlAccStats averageStats);
  84. public delegate void OnNetworkTypeChangedHandler(RtcConnection connection, NETWORK_TYPE type);
  85. public delegate void OnEncryptionErrorHandler(RtcConnection connection, ENCRYPTION_ERROR_TYPE errorType);
  86. public delegate void OnUploadLogResultHandler(RtcConnection connection, string requestId, bool success, UPLOAD_ERROR_REASON reason);
  87. public delegate void OnUserAccountUpdatedHandler(RtcConnection connection, uint remoteUid, string userAccount);
  88. public delegate void OnPermissionErrorHandler(PERMISSION_TYPE permissionType);
  89. public delegate void OnLocalUserRegisteredHandler(uint uid, string userAccount);
  90. public delegate void OnUserInfoUpdatedHandler(uint uid, UserInfo info);
  91. public delegate void OnAudioSubscribeStateChangedHandler(string channel, uint uid, STREAM_SUBSCRIBE_STATE oldState, STREAM_SUBSCRIBE_STATE newState, int elapseSinceLastState);
  92. public delegate void OnVideoSubscribeStateChangedHandler(string channel, uint uid, STREAM_SUBSCRIBE_STATE oldState, STREAM_SUBSCRIBE_STATE newState, int elapseSinceLastState);
  93. public delegate void OnAudioPublishStateChangedHandler(string channel, STREAM_PUBLISH_STATE oldState, STREAM_PUBLISH_STATE newState, int elapseSinceLastState);
  94. public delegate void OnVideoPublishStateChangedHandler(VIDEO_SOURCE_TYPE source, string channel, STREAM_PUBLISH_STATE oldState, STREAM_PUBLISH_STATE newState, int elapseSinceLastState);
  95. public delegate void OnExtensionEventHandler(string provider, string extension, string key, string value);
  96. public delegate void OnExtensionStartedHandler(string provider, string extension);
  97. public delegate void OnExtensionStoppedHandler(string provider, string extension);
  98. public delegate void OnExtensionErrorHandler(string provider, string extension, int error, string message);
  99. public delegate void OnDirectCdnStreamingStateChangedHandler(DIRECT_CDN_STREAMING_STATE state, DIRECT_CDN_STREAMING_ERROR error, string message);
  100. public delegate void OnDirectCdnStreamingStatsHandler(DirectCdnStreamingStats stats);
  101. public class RtcEngineEventHandler : IRtcEngineEventHandler
  102. {
  103. public event OnJoinChannelSuccessHandler EventOnJoinChannelSuccess;
  104. public event OnLeaveChannelHandler EventOnLeaveChannel;
  105. public event OnErrorHandler EventOnError;
  106. public event OnRejoinChannelSuccessHandler EventOnRejoinChannelSuccess;
  107. public event OnProxyConnectedHandler EventOnProxyConnected;
  108. public event OnAudioQualityHandler EventOnAudioQuality;
  109. public event OnLastmileProbeResultHandler EventOnLastmileProbeResult;
  110. public event OnAudioVolumeIndicationHandler EventOnAudioVolumeIndication;
  111. public event OnRtcStatsHandler EventOnRtcStats;
  112. public event OnAudioDeviceStateChangedHandler EventOnAudioDeviceStateChanged;
  113. public event OnAudioMixingFinishedHandler EventOnAudioMixingFinished;
  114. public event OnAudioEffectFinishedHandler EventOnAudioEffectFinished;
  115. public event OnVideoDeviceStateChangedHandler EventOnVideoDeviceStateChanged;
  116. public event OnMediaDeviceChangedHandler EventOnMediaDeviceChanged;
  117. public event OnNetworkQualityHandler EventOnNetworkQuality;
  118. public event OnIntraRequestReceivedHandler EventOnIntraRequestReceived;
  119. public event OnUplinkNetworkInfoUpdatedHandler EventOnUplinkNetworkInfoUpdated;
  120. public event OnDownlinkNetworkInfoUpdatedHandler EventOnDownlinkNetworkInfoUpdated;
  121. public event OnLastmileQualityHandler EventOnLastmileQuality;
  122. public event OnFirstLocalVideoFrameHandler EventOnFirstLocalVideoFrame;
  123. public event OnFirstLocalVideoFramePublishedHandler EventOnFirstLocalVideoFramePublished;
  124. public event OnVideoSourceFrameSizeChangedHandler EventOnVideoSourceFrameSizeChanged;
  125. public event OnFirstRemoteVideoDecodedHandler EventOnFirstRemoteVideoDecoded;
  126. public event OnVideoSizeChangedHandler EventOnVideoSizeChanged;
  127. public event OnContentInspectResultHandler EventOnContentInspectResult;
  128. public event OnSnapshotTakenHandlerEx EventOnSnapshotTakenEx;
  129. public event OnLocalVideoStateChangedHandler EventOnLocalVideoStateChanged;
  130. public event OnLocalVideoStateChangedHandlerEx EventOnLocalVideoStateChangedEx;
  131. public event OnRemoteVideoStateChangedHandler EventOnRemoteVideoStateChanged;
  132. public event OnFirstRemoteVideoFrameHandler EventOnFirstRemoteVideoFrame;
  133. public event OnUserJoinedHandler EventOnUserJoined;
  134. public event OnUserOfflineHandler EventOnUserOffline;
  135. public event OnUserMuteAudioHandler EventOnUserMuteAudio;
  136. public event OnUserMuteVideoHandler EventOnUserMuteVideo;
  137. public event OnUserEnableVideoHandler EventOnUserEnableVideo;
  138. public event OnUserEnableLocalVideoHandler EventOnUserEnableLocalVideo;
  139. public event OnUserStateChangedHandler EventOnUserStateChanged;
  140. public event OnApiCallExecutedHandler EventOnApiCallExecuted;
  141. public event OnLocalAudioStatsHandler EventOnLocalAudioStats;
  142. public event OnRemoteAudioStatsHandler EventOnRemoteAudioStats;
  143. public event OnLocalVideoStatsHandler EventOnLocalVideoStats;
  144. public event OnRemoteVideoStatsHandler EventOnRemoteVideoStats;
  145. public event OnCameraReadyHandler EventOnCameraReady;
  146. public event OnCameraFocusAreaChangedHandler EventOnCameraFocusAreaChanged;
  147. public event OnCameraExposureAreaChangedHandler EventOnCameraExposureAreaChanged;
  148. public event OnFacePositionChangedHandler EventOnFacePositionChanged;
  149. public event OnVideoStoppedHandler EventOnVideoStopped;
  150. public event OnAudioMixingStateChangedHandler EventOnAudioMixingStateChanged;
  151. public event OnRhythmPlayerStateChangedHandler EventOnRhythmPlayerStateChanged;
  152. public event OnConnectionLostHandler EventOnConnectionLost;
  153. public event OnConnectionInterruptedHandler EventOnConnectionInterrupted;
  154. public event OnConnectionBannedHandler EventOnConnectionBanned;
  155. public event OnStreamMessageHandler EventOnStreamMessage;
  156. public event OnStreamMessageErrorHandler EventOnStreamMessageError;
  157. public event OnRequestTokenHandler EventOnRequestToken;
  158. public event OnTokenPrivilegeWillExpireHandler EventOnTokenPrivilegeWillExpire;
  159. public event OnFirstLocalAudioFramePublishedHandler EventOnFirstLocalAudioFramePublished;
  160. public event OnFirstRemoteAudioFrameHandler EventOnFirstRemoteAudioFrame;
  161. public event OnFirstRemoteAudioDecodedHandler EventOnFirstRemoteAudioDecoded;
  162. public event OnLocalAudioStateChangedHandler EventOnLocalAudioStateChanged;
  163. public event OnRemoteAudioStateChangedHandler EventOnRemoteAudioStateChanged;
  164. public event OnActiveSpeakerHandler EventOnActiveSpeaker;
  165. public event OnClientRoleChangedHandler EventOnClientRoleChanged;
  166. public event OnClientRoleChangeFailedHandler EventOnClientRoleChangeFailed;
  167. public event OnAudioDeviceVolumeChangedHandler EventOnAudioDeviceVolumeChanged;
  168. public event OnRtmpStreamingStateChangedHandler EventOnRtmpStreamingStateChanged;
  169. public event OnRtmpStreamingEventHandler EventOnRtmpStreamingEvent;
  170. //public event OnStreamPublishedHandler EventOnStreamPublished;
  171. //public event OnStreamUnpublishedHandler EventOnStreamUnpublished;
  172. public event OnTranscodingUpdatedHandler EventOnTranscodingUpdated;
  173. public event OnAudioRoutingChangedHandler EventOnAudioRoutingChanged;
  174. public event OnChannelMediaRelayStateChangedHandler EventOnChannelMediaRelayStateChanged;
  175. public event OnChannelMediaRelayEventHandler EventOnChannelMediaRelayEvent;
  176. public event OnLocalPublishFallbackToAudioOnlyHandler EventOnLocalPublishFallbackToAudioOnly;
  177. public event OnRemoteSubscribeFallbackToAudioOnlyHandler EventOnRemoteSubscribeFallbackToAudioOnly;
  178. public event OnRemoteAudioTransportStatsHandler EventOnRemoteAudioTransportStats;
  179. public event OnRemoteVideoTransportStatsHandler EventOnRemoteVideoTransportStats;
  180. public event OnConnectionStateChangedHandler EventOnConnectionStateChanged;
  181. public event OnWlAccMessageHandler EventOnWlAccMessage;
  182. public event OnWlAccStatsHandler EventOnWlAccStats;
  183. public event OnNetworkTypeChangedHandler EventOnNetworkTypeChanged;
  184. public event OnEncryptionErrorHandler EventOnEncryptionError;
  185. public event OnUploadLogResultHandler EventOnUploadLogResult;
  186. public event OnUserAccountUpdatedHandler EventOnUserAccountUpdated;
  187. public event OnPermissionErrorHandler EventOnPermissionError;
  188. public event OnLocalUserRegisteredHandler EventOnLocalUserRegistered;
  189. public event OnUserInfoUpdatedHandler EventOnUserInfoUpdated;
  190. public event OnAudioSubscribeStateChangedHandler EventOnAudioSubscribeStateChanged;
  191. public event OnVideoSubscribeStateChangedHandler EventOnVideoSubscribeStateChanged;
  192. public event OnAudioPublishStateChangedHandler EventOnAudioPublishStateChanged;
  193. public event OnVideoPublishStateChangedHandler EventOnVideoPublishStateChanged;
  194. public event OnExtensionEventHandler EventOnExtensionEvent;
  195. public event OnExtensionStartedHandler EventOnExtensionStarted;
  196. public event OnExtensionStoppedHandler EventOnExtensionStopped;
  197. public event OnExtensionErrorHandler EventOnExtensionErrored;
  198. public event OnDirectCdnStreamingStateChangedHandler EventOnDirectCdnStreamingStateChanged;
  199. public event OnDirectCdnStreamingStatsHandler EventOnDirectCdnStreamingStats;
  200. private static RtcEngineEventHandler eventInstance = null;
  201. public static RtcEngineEventHandler GetInstance()
  202. {
  203. if (eventInstance == null)
  204. {
  205. eventInstance = new RtcEngineEventHandler();
  206. }
  207. return eventInstance;
  208. }
  209. public override void OnJoinChannelSuccess(RtcConnection connection, int elapsed)
  210. {
  211. if (EventOnJoinChannelSuccess == null) return;
  212. EventOnJoinChannelSuccess.Invoke(connection, elapsed);
  213. }
  214. public override void OnError(int err, string msg)
  215. {
  216. if (EventOnError == null) return;
  217. EventOnError.Invoke(err, msg);
  218. }
  219. public override void OnLeaveChannel(RtcConnection connection, RtcStats stats)
  220. {
  221. if (EventOnLeaveChannel == null) return;
  222. EventOnLeaveChannel.Invoke(connection, stats);
  223. }
  224. public override void OnRejoinChannelSuccess(RtcConnection connection, int elapsed)
  225. {
  226. if (EventOnRejoinChannelSuccess == null) return;
  227. EventOnRejoinChannelSuccess.Invoke(connection, elapsed);
  228. }
  229. public override void OnProxyConnected(string channel, uint uid, PROXY_TYPE proxyType, string localProxyIp, int elapsed)
  230. {
  231. if (EventOnProxyConnected == null) return;
  232. EventOnProxyConnected.Invoke(channel, uid, proxyType, localProxyIp, elapsed);
  233. }
  234. public override void OnAudioQuality(RtcConnection connection, uint remoteUid, int quality, UInt16 delay, UInt16 lost)
  235. {
  236. if (EventOnAudioQuality == null) return;
  237. EventOnAudioQuality.Invoke(connection, remoteUid, quality, delay, lost);
  238. }
  239. public override void OnLastmileProbeResult(LastmileProbeResult result)
  240. {
  241. if (EventOnLastmileProbeResult == null) return;
  242. EventOnLastmileProbeResult.Invoke(result);
  243. }
  244. public override void OnAudioVolumeIndication(RtcConnection connection, AudioVolumeInfo[] speakers, uint speakerNumber, int totalVolume)
  245. {
  246. if (EventOnAudioVolumeIndication == null) return;
  247. EventOnAudioVolumeIndication.Invoke(connection, speakers, speakerNumber, totalVolume);
  248. }
  249. public override void OnRtcStats(RtcConnection connection, RtcStats stats)
  250. {
  251. if (EventOnRtcStats == null) return;
  252. EventOnRtcStats.Invoke(connection, stats);
  253. }
  254. public override void OnAudioDeviceStateChanged(string deviceId, MEDIA_DEVICE_TYPE deviceType, MEDIA_DEVICE_STATE_TYPE deviceState)
  255. {
  256. if (EventOnAudioDeviceStateChanged == null) return;
  257. EventOnAudioDeviceStateChanged.Invoke(deviceId, deviceType, deviceState);
  258. }
  259. [Obsolete]
  260. public override void OnAudioMixingFinished()
  261. {
  262. if (EventOnAudioMixingFinished == null) return;
  263. EventOnAudioMixingFinished.Invoke();
  264. }
  265. public override void OnAudioEffectFinished(int soundId)
  266. {
  267. if (EventOnAudioEffectFinished == null) return;
  268. EventOnAudioEffectFinished.Invoke(soundId);
  269. }
  270. public override void OnVideoDeviceStateChanged(string deviceId, MEDIA_DEVICE_TYPE deviceType, MEDIA_DEVICE_STATE_TYPE deviceState)
  271. {
  272. if (EventOnVideoDeviceStateChanged == null) return;
  273. EventOnVideoDeviceStateChanged.Invoke(deviceId, deviceType, deviceState);
  274. }
  275. public override void OnMediaDeviceChanged(MEDIA_DEVICE_TYPE deviceType)
  276. {
  277. if (EventOnMediaDeviceChanged == null) return;
  278. EventOnMediaDeviceChanged.Invoke(deviceType);
  279. }
  280. public override void OnNetworkQuality(RtcConnection connection, uint remoteUid, int txQuality, int rxQuality)
  281. {
  282. if (EventOnNetworkQuality == null) return;
  283. EventOnNetworkQuality.Invoke(connection, remoteUid, txQuality, rxQuality);
  284. }
  285. public override void OnIntraRequestReceived(RtcConnection connection)
  286. {
  287. if (EventOnIntraRequestReceived == null) return;
  288. EventOnIntraRequestReceived.Invoke(connection);
  289. }
  290. public override void OnUplinkNetworkInfoUpdated(UplinkNetworkInfo info)
  291. {
  292. if (EventOnUplinkNetworkInfoUpdated == null) return;
  293. EventOnUplinkNetworkInfoUpdated.Invoke(info);
  294. }
  295. public override void OnDownlinkNetworkInfoUpdated(DownlinkNetworkInfo info)
  296. {
  297. if (EventOnDownlinkNetworkInfoUpdated == null) return;
  298. EventOnDownlinkNetworkInfoUpdated.Invoke(info);
  299. }
  300. public override void OnLastmileQuality(int quality)
  301. {
  302. if (EventOnLastmileQuality == null) return;
  303. EventOnLastmileQuality.Invoke(quality);
  304. }
  305. public override void OnFirstLocalVideoFrame(RtcConnection connection, int width, int height, int elapsed)
  306. {
  307. if (EventOnFirstLocalVideoFrame == null) return;
  308. EventOnFirstLocalVideoFrame.Invoke(connection, width, height, elapsed);
  309. }
  310. public override void OnFirstLocalVideoFramePublished(RtcConnection connection, int elapsed)
  311. {
  312. if (EventOnFirstLocalVideoFramePublished == null) return;
  313. EventOnFirstLocalVideoFramePublished.Invoke(connection, elapsed);
  314. }
  315. public override void OnVideoSourceFrameSizeChanged(RtcConnection connection, VIDEO_SOURCE_TYPE sourceType, int width, int height)
  316. {
  317. if (EventOnVideoSourceFrameSizeChanged == null) return;
  318. EventOnVideoSourceFrameSizeChanged.Invoke(connection, sourceType, width, height);
  319. }
  320. public override void OnFirstRemoteVideoDecoded(RtcConnection connection, uint remoteUid, int width, int height, int elapsed)
  321. {
  322. if (EventOnFirstRemoteVideoDecoded == null) return;
  323. EventOnFirstRemoteVideoDecoded.Invoke(connection, remoteUid, width, height, elapsed);
  324. }
  325. public override void OnVideoSizeChanged(RtcConnection connection, VIDEO_SOURCE_TYPE sourceType, uint uid, int width, int height, int rotation)
  326. {
  327. if (EventOnVideoSizeChanged == null) return;
  328. EventOnVideoSizeChanged.Invoke(connection, sourceType, uid, width, height, rotation);
  329. }
  330. public override void OnContentInspectResult(CONTENT_INSPECT_RESULT result)
  331. {
  332. if (EventOnContentInspectResult == null) return;
  333. EventOnContentInspectResult.Invoke(result);
  334. }
  335. public override void OnSnapshotTaken(RtcConnection connection, uint uid, string filePath, int width, int height, int errCode)
  336. {
  337. if (EventOnSnapshotTakenEx == null) return;
  338. EventOnSnapshotTakenEx.Invoke(connection, uid, filePath, width, height, errCode);
  339. }
  340. public override void OnLocalVideoStateChanged(VIDEO_SOURCE_TYPE source, LOCAL_VIDEO_STREAM_STATE state, LOCAL_VIDEO_STREAM_ERROR errorCode)
  341. {
  342. if (EventOnLocalVideoStateChanged == null) return;
  343. EventOnLocalVideoStateChanged.Invoke(source, state, errorCode);
  344. }
  345. public override void OnLocalVideoStateChanged(RtcConnection connection, LOCAL_VIDEO_STREAM_STATE state, LOCAL_VIDEO_STREAM_ERROR errorCode)
  346. {
  347. if (EventOnLocalVideoStateChangedEx == null) return;
  348. EventOnLocalVideoStateChangedEx.Invoke(connection, state, errorCode);
  349. }
  350. public override void OnRemoteVideoStateChanged(RtcConnection connection, uint remoteUid, REMOTE_VIDEO_STATE state, REMOTE_VIDEO_STATE_REASON reason, int elapsed)
  351. {
  352. if (EventOnRemoteVideoStateChanged == null) return;
  353. EventOnRemoteVideoStateChanged.Invoke(connection, remoteUid, state, reason, elapsed);
  354. }
  355. public override void OnFirstRemoteVideoFrame(RtcConnection connection, uint remoteUid, int width, int height, int elapsed)
  356. {
  357. if (EventOnFirstRemoteVideoFrame == null) return;
  358. EventOnFirstRemoteVideoFrame.Invoke(connection, remoteUid, width, height, elapsed);
  359. }
  360. public override void OnUserJoined(RtcConnection connection, uint remoteUid, int elapsed)
  361. {
  362. if (EventOnUserJoined == null) return;
  363. EventOnUserJoined.Invoke(connection, remoteUid, elapsed);
  364. }
  365. public override void OnUserOffline(RtcConnection connection, uint remoteUid, USER_OFFLINE_REASON_TYPE reason)
  366. {
  367. if (EventOnUserOffline == null) return;
  368. EventOnUserOffline.Invoke(connection, remoteUid, reason);
  369. }
  370. [Obsolete]
  371. public override void OnUserMuteAudio(RtcConnection connection, uint remoteUid, bool muted)
  372. {
  373. if (EventOnUserMuteAudio == null) return;
  374. EventOnUserMuteAudio.Invoke(connection, remoteUid, muted);
  375. }
  376. [Obsolete]
  377. public override void OnUserMuteVideo(RtcConnection connection, uint remoteUid, bool muted)
  378. {
  379. if (EventOnUserMuteVideo == null) return;
  380. EventOnUserMuteVideo.Invoke(connection, remoteUid, muted);
  381. }
  382. [Obsolete]
  383. public override void OnUserEnableVideo(RtcConnection connection, uint remoteUid, bool enabled)
  384. {
  385. if (EventOnUserEnableVideo == null) return;
  386. EventOnUserEnableVideo.Invoke(connection, remoteUid, enabled);
  387. }
  388. [Obsolete]
  389. public override void OnUserEnableLocalVideo(RtcConnection connection, uint remoteUid, bool enabled)
  390. {
  391. if (EventOnUserEnableLocalVideo == null) return;
  392. EventOnUserEnableLocalVideo.Invoke(connection, remoteUid, enabled);
  393. }
  394. public override void OnUserStateChanged(RtcConnection connection, uint remoteUid, uint state)
  395. {
  396. if (EventOnUserStateChanged == null) return;
  397. EventOnUserStateChanged.Invoke(connection, remoteUid, state);
  398. }
  399. public override void OnApiCallExecuted(int err, string api, string result)
  400. {
  401. if (EventOnApiCallExecuted == null) return;
  402. EventOnApiCallExecuted.Invoke(err, api, result);
  403. }
  404. public override void OnLocalAudioStats(RtcConnection connection, LocalAudioStats stats)
  405. {
  406. if (EventOnLocalAudioStats == null) return;
  407. EventOnLocalAudioStats.Invoke(connection, stats);
  408. }
  409. public override void OnRemoteAudioStats(RtcConnection connection, RemoteAudioStats stats)
  410. {
  411. if (EventOnRemoteAudioStats == null) return;
  412. EventOnRemoteAudioStats.Invoke(connection, stats);
  413. }
  414. public override void OnLocalVideoStats(RtcConnection connection, LocalVideoStats stats)
  415. {
  416. if (EventOnLocalVideoStats == null) return;
  417. EventOnLocalVideoStats.Invoke(connection, stats);
  418. }
  419. public override void OnRemoteVideoStats(RtcConnection connection, RemoteVideoStats stats)
  420. {
  421. if (EventOnRemoteVideoStats == null) return;
  422. EventOnRemoteVideoStats.Invoke(connection, stats);
  423. }
  424. public override void OnCameraReady()
  425. {
  426. if (EventOnCameraReady == null) return;
  427. EventOnCameraReady.Invoke();
  428. }
  429. public override void OnCameraFocusAreaChanged(int x, int y, int width, int height)
  430. {
  431. if (EventOnCameraFocusAreaChanged == null) return;
  432. EventOnCameraFocusAreaChanged.Invoke(x, y, width, height);
  433. }
  434. public override void OnCameraExposureAreaChanged(int x, int y, int width, int height)
  435. {
  436. if (EventOnCameraExposureAreaChanged == null) return;
  437. EventOnCameraExposureAreaChanged.Invoke(x, y, width, height);
  438. }
  439. public override void OnFacePositionChanged(int imageWidth, int imageHeight, Rectangle vecRectangle, int[] vecDistance, int numFaces)
  440. {
  441. if (EventOnFacePositionChanged == null) return;
  442. EventOnFacePositionChanged.Invoke(imageWidth, imageHeight, vecRectangle, vecDistance, numFaces);
  443. }
  444. public override void OnVideoStopped()
  445. {
  446. if (EventOnVideoStopped == null) return;
  447. EventOnVideoStopped.Invoke();
  448. }
  449. public override void OnAudioMixingStateChanged(AUDIO_MIXING_STATE_TYPE state, AUDIO_MIXING_REASON_TYPE reason)
  450. {
  451. if (EventOnAudioMixingStateChanged == null) return;
  452. EventOnAudioMixingStateChanged.Invoke(state, reason);
  453. }
  454. public override void OnRhythmPlayerStateChanged(RHYTHM_PLAYER_STATE_TYPE state, RHYTHM_PLAYER_ERROR_TYPE errorCode)
  455. {
  456. if (EventOnRhythmPlayerStateChanged == null) return;
  457. EventOnRhythmPlayerStateChanged.Invoke(state, errorCode);
  458. }
  459. public override void OnConnectionLost(RtcConnection connection)
  460. {
  461. if (EventOnConnectionLost == null) return;
  462. EventOnConnectionLost.Invoke(connection);
  463. }
  464. public override void OnConnectionInterrupted(RtcConnection connection)
  465. {
  466. if (EventOnConnectionInterrupted == null) return;
  467. EventOnConnectionInterrupted.Invoke(connection);
  468. }
  469. public override void OnConnectionBanned(RtcConnection connection)
  470. {
  471. if (EventOnConnectionBanned == null) return;
  472. EventOnConnectionBanned.Invoke(connection);
  473. }
  474. public override void OnStreamMessage(RtcConnection connection, uint remoteUid, int streamId, byte[] data, uint length, UInt64 sentTs)
  475. {
  476. if (EventOnStreamMessage == null) return;
  477. EventOnStreamMessage.Invoke(connection, remoteUid, streamId, data, length, sentTs);
  478. }
  479. public override void OnStreamMessageError(RtcConnection connection, uint remoteUid, int streamId, int code, int missed, int cached)
  480. {
  481. if (EventOnStreamMessageError == null) return;
  482. EventOnStreamMessageError.Invoke(connection, remoteUid, streamId, code, missed, cached);
  483. }
  484. public override void OnRequestToken(RtcConnection connection)
  485. {
  486. if (EventOnRequestToken == null) return;
  487. EventOnRequestToken.Invoke(connection);
  488. }
  489. public override void OnTokenPrivilegeWillExpire(RtcConnection connection, string token)
  490. {
  491. if (EventOnTokenPrivilegeWillExpire == null) return;
  492. EventOnTokenPrivilegeWillExpire.Invoke(connection, token);
  493. }
  494. public override void OnFirstLocalAudioFramePublished(RtcConnection connection, int elapsed)
  495. {
  496. if (EventOnFirstLocalAudioFramePublished == null) return;
  497. EventOnFirstLocalAudioFramePublished.Invoke(connection, elapsed);
  498. }
  499. public override void OnFirstRemoteAudioFrame(RtcConnection connection, uint userId, int elapsed)
  500. {
  501. if (EventOnFirstRemoteAudioFrame == null) return;
  502. EventOnFirstRemoteAudioFrame.Invoke(connection, userId, elapsed);
  503. }
  504. public override void OnFirstRemoteAudioDecoded(RtcConnection connection, uint uid, int elapsed)
  505. {
  506. if (EventOnFirstRemoteAudioDecoded == null) return;
  507. EventOnFirstRemoteAudioDecoded.Invoke(connection, uid, elapsed);
  508. }
  509. public override void OnLocalAudioStateChanged(RtcConnection connection, LOCAL_AUDIO_STREAM_STATE state, LOCAL_AUDIO_STREAM_ERROR error)
  510. {
  511. if (EventOnLocalAudioStateChanged == null) return;
  512. EventOnLocalAudioStateChanged.Invoke(connection, state, error);
  513. }
  514. public override void OnRemoteAudioStateChanged(RtcConnection connection, uint remoteUid, REMOTE_AUDIO_STATE state, REMOTE_AUDIO_STATE_REASON reason, int elapsed)
  515. {
  516. if (EventOnRemoteAudioStateChanged == null) return;
  517. EventOnRemoteAudioStateChanged.Invoke(connection, remoteUid, state, reason, elapsed);
  518. }
  519. public override void OnActiveSpeaker(RtcConnection connection, uint uid)
  520. {
  521. if (EventOnActiveSpeaker == null) return;
  522. EventOnActiveSpeaker.Invoke(connection, uid);
  523. }
  524. public override void OnClientRoleChanged(RtcConnection connection, CLIENT_ROLE_TYPE oldRole, CLIENT_ROLE_TYPE newRole)
  525. {
  526. if (EventOnClientRoleChanged == null) return;
  527. EventOnClientRoleChanged.Invoke(connection, oldRole, newRole);
  528. }
  529. public override void OnClientRoleChangeFailed(RtcConnection connection, CLIENT_ROLE_CHANGE_FAILED_REASON reason, CLIENT_ROLE_TYPE currentRole)
  530. {
  531. if (EventOnClientRoleChangeFailed == null) return;
  532. EventOnClientRoleChangeFailed.Invoke(connection, reason, currentRole);
  533. }
  534. public override void OnAudioDeviceVolumeChanged(MEDIA_DEVICE_TYPE deviceType, int volume, bool muted)
  535. {
  536. if (EventOnAudioDeviceVolumeChanged == null) return;
  537. EventOnAudioDeviceVolumeChanged.Invoke(deviceType, volume, muted);
  538. }
  539. public override void OnRtmpStreamingStateChanged(string url, RTMP_STREAM_PUBLISH_STATE state, RTMP_STREAM_PUBLISH_ERROR_TYPE errCode)
  540. {
  541. if (EventOnRtmpStreamingStateChanged == null) return;
  542. EventOnRtmpStreamingStateChanged.Invoke(url, state, errCode);
  543. }
  544. public override void OnRtmpStreamingEvent(string url, RTMP_STREAMING_EVENT eventCode)
  545. {
  546. if (EventOnRtmpStreamingEvent == null) return;
  547. EventOnRtmpStreamingEvent.Invoke(url, eventCode);
  548. }
  549. //public override void OnStreamPublished(string url, int error)
  550. //{
  551. // if (EventOnStreamPublished == null) return;
  552. // EventOnStreamPublished.Invoke(url, error);
  553. //}
  554. //[Obsolete]
  555. //public override void OnStreamUnpublished(string url)
  556. //{
  557. // if (EventOnStreamUnpublished == null) return;
  558. // EventOnStreamUnpublished.Invoke(url);
  559. //}
  560. public override void OnTranscodingUpdated()
  561. {
  562. if (EventOnTranscodingUpdated == null) return;
  563. EventOnTranscodingUpdated.Invoke();
  564. }
  565. public override void OnAudioRoutingChanged(int routing)
  566. {
  567. if (EventOnAudioRoutingChanged == null) return;
  568. EventOnAudioRoutingChanged.Invoke(routing);
  569. }
  570. //public override void OnAudioSessionRestrictionResume()
  571. //{
  572. // if (EventOnAudioSessionRestrictionResume == null) return;
  573. // EventOnAudioSessionRestrictionResume.Invoke();
  574. //}
  575. public override void OnChannelMediaRelayStateChanged(int state, int code)
  576. {
  577. if (EventOnChannelMediaRelayStateChanged == null) return;
  578. EventOnChannelMediaRelayStateChanged.Invoke(state, code);
  579. }
  580. public override void OnChannelMediaRelayEvent(int code)
  581. {
  582. if (EventOnChannelMediaRelayEvent == null) return;
  583. EventOnChannelMediaRelayEvent.Invoke(code);
  584. }
  585. public override void OnLocalPublishFallbackToAudioOnly(bool isFallbackOrRecover)
  586. {
  587. if (EventOnLocalPublishFallbackToAudioOnly == null) return;
  588. EventOnLocalPublishFallbackToAudioOnly.Invoke(isFallbackOrRecover);
  589. }
  590. public override void OnRemoteSubscribeFallbackToAudioOnly(uint uid, bool isFallbackOrRecover)
  591. {
  592. if (EventOnRemoteSubscribeFallbackToAudioOnly == null) return;
  593. EventOnRemoteSubscribeFallbackToAudioOnly.Invoke(uid, isFallbackOrRecover);
  594. }
  595. public override void OnRemoteAudioTransportStats(RtcConnection connection, uint remoteUid, UInt16 delay, UInt16 lost, UInt16 rxKBitRate)
  596. {
  597. if (EventOnRemoteAudioTransportStats == null) return;
  598. EventOnRemoteAudioTransportStats.Invoke(connection, remoteUid, delay, lost, rxKBitRate);
  599. }
  600. public override void OnRemoteVideoTransportStats(RtcConnection connection, uint remoteUid, UInt16 delay, UInt16 lost, UInt16 rxKBitRate)
  601. {
  602. if (EventOnRemoteVideoTransportStats == null) return;
  603. EventOnRemoteVideoTransportStats.Invoke(connection, remoteUid, delay, lost, rxKBitRate);
  604. }
  605. public override void OnConnectionStateChanged(RtcConnection connection, CONNECTION_STATE_TYPE state, CONNECTION_CHANGED_REASON_TYPE reason)
  606. {
  607. if (EventOnConnectionStateChanged == null) return;
  608. EventOnConnectionStateChanged.Invoke(connection, state, reason);
  609. }
  610. public override void OnWlAccMessage(RtcConnection connection, WLACC_MESSAGE_REASON reason, WLACC_SUGGEST_ACTION action, string wlAccMsg)
  611. {
  612. if (EventOnWlAccMessage == null) return;
  613. EventOnWlAccMessage.Invoke(connection, reason, action, wlAccMsg);
  614. }
  615. public override void OnWlAccStats(RtcConnection connection, WlAccStats currentStats, WlAccStats averageStats)
  616. {
  617. if (EventOnWlAccStats == null) return;
  618. EventOnWlAccStats.Invoke(connection, currentStats, averageStats);
  619. }
  620. public override void OnNetworkTypeChanged(RtcConnection connection, NETWORK_TYPE type)
  621. {
  622. if (EventOnNetworkTypeChanged == null) return;
  623. EventOnNetworkTypeChanged.Invoke(connection, type);
  624. }
  625. public override void OnEncryptionError(RtcConnection connection, ENCRYPTION_ERROR_TYPE errorType)
  626. {
  627. if (EventOnEncryptionError == null) return;
  628. EventOnEncryptionError.Invoke(connection, errorType);
  629. }
  630. public override void OnUploadLogResult(RtcConnection connection, string requestId, bool success, UPLOAD_ERROR_REASON reason)
  631. {
  632. if (EventOnUploadLogResult == null) return;
  633. EventOnUploadLogResult.Invoke(connection, requestId, success, reason);
  634. }
  635. public override void OnUserAccountUpdated(RtcConnection connection, uint remoteUid, string userAccount)
  636. {
  637. if (EventOnUserAccountUpdated == null) return;
  638. EventOnUserAccountUpdated.Invoke(connection, remoteUid, userAccount);
  639. }
  640. public override void OnPermissionError(PERMISSION_TYPE permissionType)
  641. {
  642. if (EventOnPermissionError == null) return;
  643. EventOnPermissionError.Invoke(permissionType);
  644. }
  645. public override void OnLocalUserRegistered(uint uid, string userAccount)
  646. {
  647. if (EventOnLocalUserRegistered == null) return;
  648. EventOnLocalUserRegistered.Invoke(uid, userAccount);
  649. }
  650. public override void OnUserInfoUpdated(uint uid, UserInfo info)
  651. {
  652. if (EventOnUserInfoUpdated == null) return;
  653. EventOnUserInfoUpdated.Invoke(uid, info);
  654. }
  655. public override void OnAudioSubscribeStateChanged(string channel, uint uid, STREAM_SUBSCRIBE_STATE oldState, STREAM_SUBSCRIBE_STATE newState, int elapseSinceLastState)
  656. {
  657. if (EventOnAudioSubscribeStateChanged == null) return;
  658. EventOnAudioSubscribeStateChanged.Invoke(channel, uid, oldState, newState, elapseSinceLastState);
  659. }
  660. public override void OnVideoSubscribeStateChanged(string channel, uint uid, STREAM_SUBSCRIBE_STATE oldState, STREAM_SUBSCRIBE_STATE newState, int elapseSinceLastState)
  661. {
  662. if (EventOnVideoSubscribeStateChanged == null) return;
  663. EventOnVideoSubscribeStateChanged.Invoke(channel, uid, oldState, newState, elapseSinceLastState);
  664. }
  665. public override void OnAudioPublishStateChanged(string channel, STREAM_PUBLISH_STATE oldState, STREAM_PUBLISH_STATE newState, int elapseSinceLastState)
  666. {
  667. if (EventOnAudioPublishStateChanged == null) return;
  668. EventOnAudioPublishStateChanged.Invoke(channel, oldState, newState, elapseSinceLastState);
  669. }
  670. public override void OnVideoPublishStateChanged(VIDEO_SOURCE_TYPE source, string channel, STREAM_PUBLISH_STATE oldState, STREAM_PUBLISH_STATE newState, int elapseSinceLastState)
  671. {
  672. if (EventOnVideoPublishStateChanged == null) return;
  673. EventOnVideoPublishStateChanged.Invoke(source, channel, oldState, newState, elapseSinceLastState);
  674. }
  675. public override void OnExtensionEvent(string provider, string extension, string key, string value)
  676. {
  677. if (EventOnExtensionEvent == null) return;
  678. EventOnExtensionEvent.Invoke(provider, extension, key, value);
  679. }
  680. public override void OnExtensionStarted(string provider, string extension)
  681. {
  682. if (EventOnExtensionStarted == null) return;
  683. EventOnExtensionStarted.Invoke(provider, extension);
  684. }
  685. public override void OnExtensionStopped(string provider, string extension)
  686. {
  687. if (EventOnExtensionStopped == null) return;
  688. EventOnExtensionStopped.Invoke(provider, extension);
  689. }
  690. public override void OnExtensionError(string provider, string extension, int error, string message)
  691. {
  692. if (EventOnExtensionErrored == null) return;
  693. EventOnExtensionErrored.Invoke(provider, extension, error, message);
  694. }
  695. public override void OnDirectCdnStreamingStateChanged(DIRECT_CDN_STREAMING_STATE state, DIRECT_CDN_STREAMING_ERROR error, string message)
  696. {
  697. if (EventOnExtensionErrored == null) return;
  698. EventOnDirectCdnStreamingStateChanged.Invoke(state, error, message);
  699. }
  700. public override void OnDirectCdnStreamingStats(DirectCdnStreamingStats stats)
  701. {
  702. if (EventOnExtensionErrored == null) return;
  703. EventOnDirectCdnStreamingStats.Invoke(stats);
  704. }
  705. }
  706. }