import { NativeModules } from 'react-native'; import type { Errors } from '../native/ZoomVideoSdk'; const { RNZoomVideoSdkBroadcastStreamingHelper } = NativeModules; /** * Broadcast streaming controller (host side). * * Lets the local user start, stop, and query a broadcast streaming session. * Status updates arrive via EventType.onStartBroadcastResponse, * onStopBroadcastResponse, and onGetBroadcastControlStatus. * * Requires an active session (after EventType.onSessionJoin). */ export type ZoomVideoSdkBroadcastStreamingHelperType = { /** * Determines whether the session supports broadcast streaming. */ isBroadcastStreamingSupported: () => Promise; /** * Determines whether the local user has permission to start broadcast. */ canStartBroadcast: () => Promise; /** * Starts broadcast streaming asynchronously. * Result arrives via EventType.onStartBroadcastResponse. */ startBroadcast: () => Promise; /** * Stops broadcast streaming asynchronously. * Result arrives via EventType.onStopBroadcastResponse. */ stopBroadcast: (channelID: string) => Promise; /** * Queries broadcast status asynchronously. * Result arrives via EventType.onGetBroadcastControlStatus. */ getBroadcastStatus: (channelID: string) => Promise; }; export class ZoomVideoSdkBroadcastStreamingHelper implements ZoomVideoSdkBroadcastStreamingHelperType { async isBroadcastStreamingSupported() { return await RNZoomVideoSdkBroadcastStreamingHelper.isBroadcastStreamingSupported(); } async canStartBroadcast() { return await RNZoomVideoSdkBroadcastStreamingHelper.canStartBroadcast(); } async startBroadcast() { return await RNZoomVideoSdkBroadcastStreamingHelper.startBroadcast(); } async stopBroadcast(channelID: string) { return await RNZoomVideoSdkBroadcastStreamingHelper.stopBroadcast( channelID ); } async getBroadcastStatus(channelID: string) { return await RNZoomVideoSdkBroadcastStreamingHelper.getBroadcastStatus( channelID ); } }