IDirectCdnStreamingEventHandler
The IDirectCdnStreamingEventHandler interface is used by the SDK to send CDN streaming event notifications to the app. The app receives SDK event notifications by inheriting methods from this interface.
onDirectCdnStreamingStateChanged
Callback when the CDN streaming state changes.
onDirectCdnStreamingStateChanged?(
state: DirectCdnStreamingState,
reason: DirectCdnStreamingReason,
message: string
): void;
After the host starts streaming directly to the CDN, when the streaming state changes, the SDK triggers this callback to report the new state, error code, and message. You can use this information to troubleshoot.
Parameters
- state
- The current streaming state. See DirectCdnStreamingState.
- reason
- The reason for the change in streaming state. See DirectCdnStreamingReason.
- message
- The message corresponding to the state change.
onDirectCdnStreamingStats
Callback for CDN streaming statistics.
onDirectCdnStreamingStats?(stats: DirectCdnStreamingStats): void;
During the process of pushing streams directly to CDN by the host, the SDK triggers this callback once every second.
Parameters
- stats
- Current streaming statistics. See DirectCdnStreamingStats.