startPublishMediaStream method

Future<void> startPublishMediaStream({
  1. required TRTCPublishTarget target,
  2. TRTCStreamEncoderParam? params,
  3. TRTCStreamMixingConfig? config,
})

Publish a stream. After this API is called, the TRTC server will relay the stream of the local user to a CDN (after transcoding or without transcoding), or transcode and publish the stream to a TRTC room.

target, The On-Cloud MixTranscoding settings

param, The encoding settings

config, The publishing destination

Platform not supported:

  • web
  • macOS
  • Windows

Implementation

Future<void> startPublishMediaStream(
    {required TRTCPublishTarget target,
    TRTCStreamEncoderParam? params,
    TRTCStreamMixingConfig? config}) async {
  return _cloudChannel!.invokeMethod('startPublishMediaStream', {
    'target': target.toJson(),
    'param': params?.toJson(),
    'config': config?.toJson()
  });
}