addInjectStreamUrl method Null safety

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

Injects an online media stream to a ChannelProfile.LiveBroadcasting channel.

If this method call succeeds, the server pulls the voice or video stream and injects it into a live channel. This applies to scenarios where all audience members in the channel can watch a live show and interact with each other.


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.


Parameter url The URL address to be added to the ongoing live broadcast. Valid protocols are RTMP, HLS, and FLV.

  • Supported FLV audio codec type: AAC.
  • Supported FLV video codec type: H264(AVC).

Parameter config The LiveInjectStreamConfig object, which contains the configuration information for the added voice or video stream.


Future<void> addInjectStreamUrl(String url, LiveInjectStreamConfig config) {
  return _invokeMethod('addInjectStreamUrl', {
    'url': url,
    'config': config.toJson(),