IDirectCdnStreamingEventHandler
The IDirectCdnStreamingEventHandler interface class is used by the SDK to send CDN streaming event notifications to the App. The App obtains SDK event notifications by inheriting methods of this interface class.
onDirectCdnStreamingStateChanged
Callback when the CDN streaming state changes.
onDirectCdnStreamingStateChanged?(
state: DirectCdnStreamingState,
reason: DirectCdnStreamingReason,
message: string
): void;
After the host starts direct CDN streaming, 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 every second.
Parameters
- stats
- Current streaming statistics. See DirectCdnStreamingStats.