pushVideoFrame abstract method
Publishes external raw video frames to the channel through a custom video track.
When you need to publish custom captured video in a channel, follow these steps: Call the createCustomVideoTrack method to create a video track and get the video track ID. When calling joinChannel to join a channel, set customVideoTrackId in ChannelMediaOptions to the video track ID you want to publish and set publishCustomVideoTrack to true. Call this method and specify videoTrackId as the video track ID from step 2 to publish the corresponding custom video source in the channel. After calling this method, even if you stop pushing external video frames to the SDK, the custom captured video stream will still be counted in the video duration usage and incur charges. Agora recommends taking appropriate measures based on your actual situation to avoid such video billing: If you no longer need to capture external video data, call destroyCustomVideoTrack to destroy the custom captured video track. If you only want to use the captured external video data for local preview and not publish it in the channel, call muteLocalVideoStream to stop sending the video stream, or call updateChannelMediaOptions and set publishCustomVideoTrack to false.
frameThe video frame to be pushed. See ExternalVideoFrame.videoTrackIdThe video track ID returned by the createCustomVideoTrack method. If you only need to push one external video stream, set videoTrackId to 0.
Returns When the method call succeeds, there is no return value; when fails, the AgoraRtcException exception is thrown. You need to catch the exception and handle it accordingly. See Error Codes for details and resolution suggestions.
Implementation
Future<void> pushVideoFrame(
{required ExternalVideoFrame frame, int videoTrackId = 0});