addInjectStreamUrl abstract method

Future<void> addInjectStreamUrl(
  1. String url,
  2. LiveInjectStreamConfig config
)

Injects an online media stream to a live streaming channel. Agora will soon stop the service for injecting online media streams on the client. If you have not implemented this service, Agora recommends that you do not use it. Ensure that you enable the Media Push service before using this function. See Prerequisites in Media Push. This method takes effect only when you are a host in a live streaming channel. Only one online media stream can be injected into the same channel at the same time. Call this method after joining a channel. This method injects the currently playing audio and video as audio and video sources into the ongoing live broadcast. This applies to scenarios where all users in the channel can watch a live show and interact with each other. After calling this method, the SDK triggers the streamInjectedStatus callback on the local client to report the state of injecting the online media stream; after successfully injecting the media stream, the stream joins the channel, and all users in the channel receive the userJoined callback, where uid is 666.

Param url The URL address to be added to the ongoing streaming. Valid protocols are RTMP, HLS, and HTTP-FLV. Supported audio codec type: AAC. Supported video codec type: H264 (AVC).

Param config The configuration information for the added video stream: LiveInjectStreamConfig .

Implementation

Future<void> addInjectStreamUrl(String url, LiveInjectStreamConfig config);