addMediaFilePath abstract method

Future<void> addMediaFilePath(
  1. String path,
  2. bool isClear
)

Add media file to the publish queue. Currently, only mp4 / m4a / aac files are supported, and special conversion is required.

Available since: 2.17.0 Description: Add media file to the publish queue. Currently, only mp4 / m4a / aac file are supported, and special conversion is required. Use cases: Often used in server-side publishing stream scenarios, such as AI classrooms. When to call: After calling the createMediaDataPublisher function to create a media data publisher. Caution: The mp4 file format must meet the following points:The video must be encoded as H.264 and cannot contain B frames, only I and P frames. The I frame interval is 2s, that is, a single GOP value is 2s; The frame rate, bit rate, and resolution of the video are consistent with the frame rate, bit rate, and resolution set by setVideoConfig before publishing stream; Audio encoding must be MPEG-4 AAC.

  • path Local absolute path to the media file.
  • isClear Whether to clear the publish queue.

Implementation

Future<void> addMediaFilePath(String path, bool isClear);