onApply method

void onApply(
  1. DiveRTMPService service,
  2. DiveRTMPServer server,
  3. String serviceKey
)

Override this method to setup custom streaming output.

Implementation

void onApply(DiveRTMPService service, DiveRTMPServer server, String serviceKey) {
  if (elements == null) return;

  final state = elements!.state;
  if (state.streamingOutput != null) {
    state.streamingOutput!.stop();
    state.streamingOutput!.service = service;
    state.streamingOutput!.server = server;
    state.streamingOutput!.serviceUrl = server.url;
    state.streamingOutput!.serviceKey = serviceKey;
  }
}