setLiveTranscoding method Null safety

Future<void> setLiveTranscoding(
  1. LiveTranscoding transcoding
)

Sets the video layout and audio settings for CDN live.

The SDK triggers the RtcEngineEventHandler.transcodingUpdated callback when you call this method to update the LiveTranscoding class. If you call this method to set the LiveTranscoding class for the first time, the SDK does not trigger the RtcEngineEventHandler.transcodingUpdated callback.

Note

  • Before calling the methods listed in this section:
    • This method applies to ChannelProfile.LiveBroadcasting only.
    • Ensure that you enable the RTMP Converter service before using this function. See Prerequisites in Push Streams to CDN.
    • Ensure that you call the RtcEngine.setClientRole method and set the user role as the host.
    • Ensure that you call the setLiveTranscoding method before calling the RtcEngine.addPublishStreamUrl method.
    • Agora supports pushing media streams in RTMPS protocol to the CDN only when you enable transcoding.

Parameter transcoding Sets the CDN live audio/video transcoding settings. See LiveTranscoding.

Implementation

@override
Future<void> setLiveTranscoding(LiveTranscoding transcoding) {
  return _invokeMethod('setLiveTranscoding', {
    'transcoding': transcoding.toJson(),
  });
}